Sell your primary residence at a profit and the IRS gives you something it gives almost no other asset class: a hard-coded exclusion of up to $250,000 of capital gain ($500,000 if married filing jointly). No basis tricks. No deferral mechanic. No replacement-property purchase required. Just gain you never pay federal income tax on, year after year, as long as you keep meeting two short tests.
This is IRC §121, the “home sale exclusion,” and for most middle-class and upper-middle-class American homeowners it is the single largest lifetime tax break they will ever claim.
The Headline Numbers
For sales closed in 2026:
| Filing status | Maximum gain excluded |
|---|---|
| Single | $250,000 |
| Married filing jointly | $500,000 |
| Married filing separately | $250,000 each |
| Surviving spouse (within 2 years of spouse’s death) | $500,000 if both spouses had met the tests at date of death |
These numbers are not indexed for inflation. They have not moved since Congress set them in the Taxpayer Relief Act of 1997, which is why they create such a pinch in high-cost coastal markets where a 25-year-tenured home can easily run $1M+ in unrealized gain.
The exclusion applies to gain, not sale price — basis (purchase price plus capital improvements minus depreciation) comes off first.
The Two Tests (Both Required)
To claim the full exclusion you must pass two tests measured against the 5-year period ending on the sale date:
- Ownership test — you owned the home for at least 24 months (2 years) out of the prior 5 years.
- Use test — you used the home as your principal residence for at least 24 months out of the prior 5 years.
The 24 months do not have to be consecutive. They do not have to be the same 24 months for ownership and use. A home you rented out for 3 years, then bought from the landlord and moved into for 2 years before selling, would pass both tests if the timing lined up.
Joint $500k rule for MFJ: to get the full $500k, the couple must satisfy three conditions:
- Either spouse meets the ownership test;
- Both spouses meet the use test (both lived there 2 of 5);
- Neither spouse used §121 on another sale in the 2 years before this one.
If only one spouse meets the use test (e.g., they married mid-year and one only moved in 12 months ago), the couple is capped at $250k.
The “Once Every 2 Years” Rule
Even if you pass ownership and use, you cannot claim §121 if you already used it on another home sale within the 2 years before the current sale. This stops serial house-flippers from stacking exclusions every six months.
The 2-year clock runs sale-to-sale, not by calendar year. Sold home A on 2024-08-15 and claimed §121? Home B sale must close on or after 2026-08-15 to qualify.
Worked Example A — Full Exclusion (MFJ)
| Item | Amount |
|---|---|
| Purchase price (2020-05) | $400,000 |
| Capital improvements (kitchen, addition) | $50,000 |
| Adjusted basis | $450,000 |
| Sale price (2026-06) | $800,000 |
| Selling costs (agent, closing) | $50,000 |
| Amount realized | $750,000 |
| Gain = $750,000 − $450,000 | $300,000 |
Couple is MFJ, both lived in the home all 6 years, neither used §121 since 2020. Both tests pass, joint $500k cap available.
- Excluded under §121: $300,000 (well under $500k cap)
- Taxable gain: $0
- Federal tax on the sale: $0
If they were single and otherwise identical, the answer is also $0 — gain ($300k) exceeds the $250k single cap by $50k, but if filing jointly the cap is $500k, so the entire gain is sheltered.
Worked Example B — Partial Exclusion (Hardship Move)
A couple bought a townhouse in 2025-04 for $600,000 and sold in 2026-04 for $900,000. Selling costs $40,000, no improvements.
- Adjusted basis: $600,000
- Amount realized: $860,000
- Gain: $260,000
They owned and used the home for only 12 months — well short of the 24-month rule. Default answer: no §121.
But Treasury Reg §1.121-3 allows a reduced (pro-rata) exclusion if the primary reason for the sale was one of three “qualifying events”:
- Change in place of employment — new job (or new self-employment) at a location 50+ miles farther from the old home than the old job was (the “50-mile test”). Job loss followed by a relocation also counts.
- Health — sale to obtain or facilitate medical care for the taxpayer, spouse, child, parent, or other qualifying person.
- Unforeseen circumstances — death, divorce/legal separation, multiple births from the same pregnancy, becoming eligible for unemployment, change in employment leaving the taxpayer unable to pay basic living expenses, condemnation/casualty loss to the home, or other facts the IRS treats as unforeseen.
If the couple moves because one spouse takes a new job 90 miles away, they qualify for partial exclusion.
Pro-rata math: the cap is multiplied by (months of use ÷ 24).
- MFJ cap: $500,000
- Months used: 12
- Reduced cap: $500,000 × (12 / 24) = $250,000
- Gain: $260,000
- Excluded: $250,000
- Taxable LTCG: $10,000
That $10,000 sits in the 0/15/20% LTCG brackets depending on the couple’s other income, plus NIIT if MAGI is over the $250k MFJ threshold. The exact bill is tiny — but the difference between “partial §121” and “no §121” was a $50,000+ tax swing.
Non-Qualified Use (The Post-2008 Trap)
The Housing Assistance Tax Act of 2008 added a rule that often surprises people who lived in a property after first using it as a rental.
For any sale after 2008, the portion of gain attributable to non-qualified use (any period the home was NOT a principal residence) after January 1, 2009 is not excludable, even if the home becomes your residence later and you pass both tests.
The pro-rata formula:
Non-excludable gain = Total gain × (Non-qualified use periods after 2009 / Total ownership period)
Example: Bought a condo in 2015 as a pure rental. Rented it 2015–2024 (10 years). Moved in 2024, lived there 2 years, sold in 2026. Total ownership 11 years. Non-qualified use period (post-2009 rental years) = 10. Qualified use = 1 year as primary + the 2 years you lived there before sale (so 2 years total of qualified use? — actually the 2 years you lived in it before sale are qualified). Recompute:
- Total ownership = 11 years
- Non-qualified period (post-2009 rental years before moving in) = 9 years
- Qualified period (2 years residence) = 2 years
- Gain (say) = $300,000
- Non-excludable portion = $300,000 × (9 / 11) = $245,455 — taxable LTCG
- §121-eligible portion = $300,000 × (2 / 11) = $54,545 — eligible for exclusion (within $250k single cap)
The pre-2009 rental years are not counted as non-qualified — they’re a freebie under the grandfather rule.
This is why simply “moving into a rental for 2 years before selling” no longer washes 100% of the gain. It only washes the residence portion of the post-2009 ownership history.
Depreciation Recapture Is Never Excluded
Any depreciation you (or a previous owner via §1014 step-up rules) claimed during a rental period of the property is recaptured at a flat 25% maximum federal rate (unrecaptured §1250 gain). §121 does not shelter this — even within the $250k/$500k cap.
So in the partial-rental example above, on top of the non-qualified-use math, any depreciation claimed during the 10 rental years is taxed at up to 25% federal, full stop.
State Conformity
Most states piggyback on federal AGI and inherit the §121 exclusion automatically. California, despite having a state income tax of its own, conforms to §121 — the $250k/$500k cap applies for CA purposes too. Watch for state-specific basis differences if the home was bought before California’s last federal-state basis sync.
States with no income tax (FL, TX, NV, WA, TN, AK, SD, WY, NH) make this moot at state level.
Take particular care in NY, MA, NJ for nonresident home-sale withholding rules even when the federal gain is fully excluded — those are withholding mechanics, not tax assessments, but they tie up cash for 6–12 months.
§1031 vs §121 — Choose or Combine
Two real-estate-specific tax breaks, often confused:
| §1031 like-kind exchange | §121 home sale exclusion | |
|---|---|---|
| Property type | Investment / business | Principal residence |
| Mechanism | Defer gain into replacement property | Exclude gain outright |
| Cap | None (defer 100%) | $250k / $500k |
| Holding period | None (just intent at time of exchange) | 2 of last 5 years |
| Replacement required | Yes (45/180-day rules) | No |
Can you stack them? Yes — the classic move is to §1031 into a rental, hold it as a rental for 2+ years (Rev Proc 2008-16 safe harbor), then convert it to your principal residence, live there 2+ years to meet the §121 use test, and sell. The §1031 part defers the original gain; the §121 part excludes up to $250k/$500k of the new gain. BUT:
- A 5-year minimum holding period applies before §121 can be claimed on a §1031-acquired property (added by the American Jobs Creation Act of 2004).
- The non-qualified use rule still bites on any post-2009 rental period.
It’s powerful, but the rules are stacked. Run a worked model before committing to the strategy.
Decision Framework
When you’re sitting on substantial home equity, these are the levers:
-
Track basis aggressively. Every kitchen, every bathroom, every roof — keep receipts. A $50k addition is $50k of gain you never pay tax on. The IRS allows decades-old improvements as long as you can substantiate.
-
Time the sale around the 2-year clock. If you’re at 22 months of use and considering listing, the 2-month wait can be worth $50,000+ of federal tax depending on bracket. A bridge rental is often cheaper than the tax hit.
-
Document hardship triggers. New job offer letters, doctor’s notes, divorce filings, military PCS orders — all support partial exclusion if a forced sale comes inside 2 years.
-
For gain above the cap: consider an installment sale under §453 to spread the excess over multiple years (keeps you in lower LTCG brackets and below the NIIT threshold). Or convert to a rental, depreciate, and pursue §1031 deferral on the next move.
-
For surviving spouses: sell within 2 years of the spouse’s death to lock in the $500k MFJ cap (otherwise it drops to $250k single). This is one of the most expensive deadlines in personal tax — easy to miss while grieving.
-
For couples planning to marry: if both spouses sell their pre-marriage homes the same year, each can claim a separate $250k exclusion (one spouse meets ownership/use on each home). Combined $500k without needing the joint test. Often better than waiting.
Related Reading
- 1031 exchange: defer capital gains on real estate — the investment-property counterpart
- Capital gains tax rates and thresholds for 2026 — the rates that apply to gain above the §121 cap
- Rental property tax guide — depreciation, basis, and what recapture looks like
FAQs
Do I have to buy another house to claim §121?
No. The §121 exclusion is unconditional — you can take the cash, rent for the rest of your life, and never pay tax on the excluded gain. This is what makes it different from a §1031 exchange (where you must reinvest) or the old pre-1997 “rollover” rule (which was repealed).
Can I claim §121 on a home I sold to my child or relative?
Yes — §121 has no related-party restriction (unlike §1031). The sale must be at arm’s-length fair market value to avoid gift-tax issues on the spread, but a bona fide sale to a relative is fully eligible for the exclusion.
What if my gain is above the $250k/$500k cap?
Only the excess is taxable. Excess gain hits the long-term capital gains brackets (0% / 15% / 20%) based on your taxable income, plus 3.8% NIIT if MAGI exceeds $200k single / $250k MFJ. Use the capital gains tax calculator to estimate the federal bite on the excess, then layer state tax separately.