Back to Calculator
Back to Guides

Section 121 Explained: The Complete Guide to the Primary Residence Exclusion

Last updated: February 2, 2026~8 min read

A plain-language guide to the "2-out-of-5-year rule" that lets you exclude up to $250,000 (or $500,000 if married) of capital gains when selling your home.
For rent vs. sell decision guidance, see our Accidental Landlord Guide.

$250K
Single Filer Exclusion
$500K
Married Filing Jointly
2 Years
Ownership + Residence
5 Years
Lookback Window

Executive Summary

If you've owned and lived in your home for at least 2 of the past 5 years, you can exclude up to $250,000 of capital gains from taxes when you sell ($500,000 if married filing jointly). This guide explains the eligibility rules, special cases for married couples, and key strategies to maximize this benefit.

1. Eligibility: The Two Tests

To qualify for the IRS Section 121 exclusion (also called the primary residence exclusion or home sale exclusion), you must pass two independent tests within the 5-year period before selling:

TestRequirement
Ownership TestYou owned the home for at least 24 months (2 years) during the 5-year lookback period. Your name was on the deed.
Use TestYou lived in the home as your primary residence for at least 24 months (2 years) during the 5-year lookback period. You physically occupied it.

The 24 months don't need to be consecutive—you can add up fragmented periods of ownership or residence within the 5-year window.

Rules for Married Couples

For married couples filing jointly, the Ownership and Use tests are treated differently:

TestWho Must Meet It?
Ownership TestOnly ONE spouse needs to have owned the home for 2 years
Use TestBOTH spouses must have lived there for 2 years
Prior ExclusionNEITHER spouse can have used Section 121 in the past 2 years

Note: If only one spouse meets the Use Test, the couple can still claim the single-filer exclusion ($250,000) instead of the married exclusion ($500,000).

Do You Qualify? Answer These Questions

Looking at the 5 years before your sale date, answer these questions:

Single Filers → $250,000 Exclusion

1

Did you own the home for at least 24 months?

2

Did you live there as your primary residence for at least 24 months?

3

Have you not used this exclusion on another home in the past 2 years?

All "Yes"? → You qualify for up to $250,000 exclusion

Married Filing Jointly → $500,000 Exclusion

1

Did at least one of you own the home for at least 24 months?

2

Did you live there as your primary residence for at least 24 months?

3

Did your spouse live there as their primary residence for at least 24 months?

4

Has neither of you used this exclusion on another home in the past 2 years?

All "Yes"? → You qualify for up to $500,000 exclusion

2. Partial Exclusion: When You Don't Fully Qualify

If you don't meet the full 2-year requirements, you may still qualify for a partial exclusion in two scenarios:

Scenario A: Life Events (Selling Early)

If you need to sell before meeting the 2-year requirement due to certain life events, your exclusion is prorated based on how long you actually lived there:

Partial Exclusion = Maximum Exclusion × (Days You Lived There ÷ 730)

Qualifying life events:

  • Change in employment — New job at least 50 miles farther from your home; layoff; transfer
  • Health reasons — Doctor recommends moving; caring for sick family member
  • Unforeseen circumstances — Death; divorce; natural disaster; multiple births

Example: Early Sale Due to Job Transfer

  • • Single filer, maximum exclusion: $250,000
  • • Lived in home: 365 days (1 year) before job transfer
  • • Partial exclusion: $250,000 × (365 ÷ 730) = $125,000
  • • If gain is $80,000 → Fully excluded (under $125,000 limit)

Scenario B: Renting Before Living There (Non-Qualified Use)

If you rented out the property before living in it (after 2008), a portion of your gain is allocated to that rental period and cannot be excluded. This is called "non-qualified use."

Non-Excludable Gain = Total Gain × (Rental Years Before Living There ÷ Total Years Owned)

Example: Rent First, Then Live (Partial Exclusion)

Single filer bought in 2014, rented 5 years, lived there 5 years, sold in 2024.

Step 1: Calculate Non-Qualified Portion (always taxable)

$300,000 × (5 rental yrs ÷ 10 total yrs) = $150,000

Step 2: Calculate Qualified Portion (eligible for exclusion)

$300,000 − $150,000 = $150,000

Step 3: Apply the $250K Cap

min($150,000, $250,000) = $150,000 excluded

Step 4: Calculate Taxable Gain

$300,000 − $150,000 = $150,000 taxable

Compare: Live First, Then Rent (Full Exclusion)

Same property, same $300,000 gain—but you lived there first for 2 years, then rented for 3 years.

Step 1: Calculate Non-Qualified Portion

$0 — Rental after residence doesn't count as non-qualified use

Step 2: Calculate Qualified Portion

$300,000 − $0 = $300,000

Step 3: Apply the $250K Cap

min($300,000, $250,000) = $250,000 excluded

Step 4: Calculate Taxable Gain

$300,000 − $250,000 = $50,000 taxable

Key insight: The order matters. In the examples above, "Live First" saves $100,000 in taxable gain ($50K vs $150K). Rental use after you move out does NOT count as non-qualified use. Always live first if possible.

3. The 3-Year Window for Accidental Landlords

If you've lived in your home for 2+ years and are now moving out, you have a powerful strategic option: rent it out for up to 3 years while preserving your Section 121 exclusion.

Why 3 Years?

The math is simple: You need 2 years of residence within a 5-year lookback window. If you move out today after living there for 2 years, you have 3 years until that residence period falls outside the window.

Timeline Example

  • Years 1-2: Lived in home ✓
  • Year 3: Move out, start renting to tenants
  • Years 3-5: Collect rental income
  • End of Year 5: Last chance to sell with exclusion
  • Year 6+: Exclusion lost (residence no longer within 5-year window)

The "Trial Run" Strategy

This creates a unique opportunity to test being a landlord with a safety net:

  • Rent your home to tenants and collect income
  • If you hate landlording or the market spikes → sell and claim your tax-free exclusion
  • If you love it → keep the rental (but accept the exclusion will expire)

Key benefit: Rental use after you move out does NOT reduce your exclusion. You get the full benefit, minus depreciation recapture (see next section).

Pro tip: Set a calendar reminder for 2.5 years after move-out. At that point, evaluate whether to sell (capture the tax-free exclusion) or hold longer (and accept eventual taxation).

For a complete rent-vs-sell decision framework including cash flow and ROI analysis, see our Accidental Landlord Guide.

4. Depreciation Recapture

Even if you qualify for the full Section 121 exclusion, there's one tax you cannot avoid: depreciation recapture.

What is Depreciation Recapture?

When you rent a property, you take depreciation deductions each year (~3.6% of building value). These deductions reduce your taxable rental income. When you sell, the IRS "recaptures" this benefit by taxing the depreciation at a flat 25% rate.

Example: Full Exclusion + Depreciation Recapture

  • • Lived in home 2 years, rented 3 years, then sold
  • • Capital gain: $150,000 → Fully excluded under Section 121
  • • Depreciation taken during rental years: $26,400
  • Tax on depreciation recapture: $26,400 × 25% = $6,600

Even with full capital gains exclusion, you still owe $6,600.

For more on how depreciation works and other rental property tax rules, see our Tax Guide.

5. Key Takeaways

The core rule: own + live for 2 of the last 5 years

Pass both the Ownership Test and Use Test to qualify for up to $250K (single) or $500K (married) exclusion.

Married couples: both must live there, only one must own

A common planning opportunity—one spouse can hold title while both reside there.

The exclusion is renewable

You can use it again and again, generally once every 2 years.

Depreciation recapture is unavoidable

Even with full Section 121 exclusion, you'll pay 25% tax on depreciation taken during rental years.

Disclaimer: This guide provides general educational information about U.S. tax law. Tax laws change frequently and individual circumstances vary. The information here should not be considered tax advice. Always consult a qualified tax professional before making decisions that affect your taxes.

Last updated: February 2026