Capital gains tax on home sales: Section 121 exclusion, recapture, and how to actually owe less
Most home sellers owe zero tax thanks to Section 121 — but for high-appreciation homes the bill can hit six figures. Here’s how it works and how to reduce it.
Last updated April 2026
On this page
- Section 121: the big exclusion
- Calculating the gain (it’s not just sale minus purchase)
- Example 1: no tax owed
- Example 2: significant tax owed
- Depreciation recapture (the trap on rented homes)
- Partial exclusion for qualifying reasons
- Strategies to actually reduce the tax
- The “moved out, still own” scenario
- Common mistakes
- Tools you’ll use
Most home sellers owe ZERO capital gains tax thanks to the Section 121 exclusion. But for high-appreciation homes — especially in coastal markets — or for properties that were ever rented, the tax can easily hit six figures. There are specific moves to reduce it, and most of them require planning before you list, not after.
This is a guide, not tax advice. For a high-gain sale, hire a CPA.
Section 121: the big exclusion
If you sold your primary residence at a gain, the IRS lets you exclude a chunk of it from taxation entirely:
- Single filer: first $250,000 of gain excluded
- Married filing jointly: first $500,000 excluded
To qualify, you need to pass three tests:
- Ownership test. Owned the home at least 2 of the last 5 years (counted from the closing date of the sale).
- Use test. Lived in it as your primary residence at least 2 of the last 5 years (24 months total, doesn’t need to be consecutive). For married couples filing jointly to claim the full $500k, BOTH spouses must pass the use test, but only ONE needs to pass the ownership test — and neither spouse can have used 121 in the prior 2 years.
- Look-back test. Haven’t used the Section 121 exclusion on another home sale in the last 2 years.
Pass all three, and the first $250k/$500k of gain disappears for tax purposes. This is why most sellers owe nothing.
Surviving spouse rule. If your spouse died, you can still claim the full $500k MFJ exclusion if you sell within 2 years of the date of death AND you haven’t remarried — assuming the ownership/use tests were met immediately before death. After that 2-year window the limit drops to $250k.
Nonqualified use (post-2008 rule). This is the trap most generalist guides miss. If the home was used as something other than your primary residence AFTER January 1, 2009 (a rental, a vacation home), the portion of gain attributable to that nonqualified period is NOT excludable, even if you later move in and pass the 2-of-5 tests. Key nuance: any rental period AFTER you last used it as primary doesn’t count as nonqualified use (so the “move out and rent it” play still works inside the 5-year window). Rental BEFORE you ever moved in does count and reduces the exclusion pro-rata.
Calculating the gain (it’s not just sale minus purchase)
The taxable number is adjusted gain, not raw appreciation. Two calculations:
Amount realized:
- Selling price
- MINUS selling costs (agent commission, transfer tax, title insurance, recording fees, attorney fees)
- = Net proceeds the IRS considers you “received”
Adjusted basis:
- Original purchase price
- PLUS capital improvements (additions, kitchen remodel, new roof, new HVAC, finished basement — NOT routine maintenance)
- MINUS any depreciation taken or that you should have taken (if the property was ever rented)
- = Your “investment” for tax purposes
Gain = Amount realized − Adjusted basis.
Then apply Section 121 to get your taxable gain.
Example 1: no tax owed
You bought your home in 2014 for $300,000. You’re selling in 2026 for $700,000. Selling costs (commission, transfer tax, title): $50,000. Over the years you put in $30,000 of capital improvements (new roof, new HVAC, kitchen reno). You’re married, filing jointly.
- Amount realized: $700,000 − $50,000 = $650,000
- Adjusted basis: $300,000 + $30,000 = $330,000
- Gain: $650,000 − $330,000 = $320,000
- Section 121 exclusion (MFJ): $500,000
Your $320k gain is fully covered by the $500k exclusion. Tax owed: $0. No 1099-S filing technically required either, since the gain is under the exclusion (though your title company may still issue one).
Example 2: significant tax owed
You bought a home in coastal CA in 2009 for $400,000. You’re selling in 2026 for $1,600,000. Selling costs: $120,000. You never documented capital improvements (oof). Married, filing jointly.
- Amount realized: $1,600,000 − $120,000 = $1,480,000
- Adjusted basis: $400,000 (no improvements claimed)
- Gain: $1,080,000
- Section 121 exclusion (MFJ): $500,000
- Taxable gain: $580,000
Now the bill (rough — depends on other income):
- Federal long-term capital gains. A $580k gain straddles the 15% and 20% LTCG brackets. Assuming this couple has typical W-2 income on top, most of the gain falls in the 20% bracket: roughly $110,000–$116,000.
- Net Investment Income Tax (NIIT) of 3.8% on the lesser of net investment income or MAGI above $250k MFJ. On a $580k gain that’s effectively the full 3.8%: ~$22,000.
- California state tax. CA taxes cap gains as ordinary income. At this income level the marginal rate is closer to 11.3% (or 12.3%+ with the mental health surcharge above $1M of taxable income), not 9.3%: ~$66,000.
Total tax: roughly $200,000. Run your specific numbers; brackets shift with your other income.
If you’d documented $80k of capital improvements over the years (easily plausible — one kitchen reno gets you most of the way), your tax bill drops by roughly $26k. Document everything.
Depreciation recapture (the trap on rented homes)
If you ever rented out the property, you were required to take depreciation (residential rental: 27.5-year straight-line). Whether you DID or DIDN’T, the IRS recaptures it on sale — the “allowed or allowable” rule. Skipping depreciation does NOT save you the recapture; it just means you missed a deduction.
For real estate, this is unrecaptured Section 1250 gain, taxed at your ordinary rate but capped at 25% federal. (Different rule than Section 1245 / personal property recapture, which is fully ordinary.) NIIT (3.8%) and state tax stack on top.
Crucially: recapture is OUTSIDE Section 121. The exclusion does not shield it.
Concrete: you bought a property as a rental, depreciated $100,000 over the years, then converted it to your primary residence for 3+ years and sold. The $100k of recapture = up to $25,000 of federal tax plus $3,800 of NIIT plus state tax — even if Section 121 covers everything else.
Cost segregation amplifies this. If you accelerated depreciation on a rental via a cost seg study (5-, 7-, 15-year asset reclassification, bonus depreciation), the personal-property components recapture as ORDINARY income under §1245 — not capped at 25%. Cost seg is a powerful deferral tool but the recapture math on exit is real. Get a CPA involved before you sell a property that’s had a cost seg study.
This catches a lot of people who house-hacked, rented out a home during a job relocation, or did the live-in-rental conversion play. It also catches anyone who claimed a home office deduction with depreciation on Form 8829 — that depreciation is recaptured too.
Partial exclusion for qualifying reasons
Sold before hitting the 2-year mark? You may still get a pro-rated exclusion if the sale was driven by:
- Job change — new job at least 50 miles farther from the home than the old job was (the safe harbor in Reg. §1.121-3(c)).
- Health reasons (yours, your family’s, or a doctor-recommended move — needs documentation).
- Unforeseen circumstances (divorce/legal separation, death, multiple births from one pregnancy, job loss qualifying for unemployment, change in employment leaving you unable to pay basic living expenses, condemnation, casualty loss).
The exclusion is pro-rated based on the SHORTER of (a) time you met the ownership test or (b) time you met the use test, divided by 24 months. Lived there 12 of 24 months? You get 50% of the LIMIT — $125k single, $250k MFJ. (Note: it’s 50% of the cap, not 50% of the gain. If your actual gain is $80k and you qualify for 50% partial exclusion, the full $80k is excluded because it falls below the $125k prorated cap.)
If the gain on a sub-2-year sale fits in the partial exclusion, no tax. Don’t leave this on the table.
Strategies to actually reduce the tax
If you’re facing a real bill, the moves that work:
- Track every capital improvement, with receipts. The IRS test: an improvement BETTERS the property, RESTORES it to like-new, or ADAPTS it to a new use (Reg. §1.263(a)-3 — the “BAR” test). Examples: kitchen reno, bathroom reno, additions, new roof, new HVAC system, new windows, finished basement, deck, fence, permanent landscaping. A REPAIR (painting, fixing a faucet, patching drywall, replacing carpet with similar carpet) is NOT added to basis on a personal residence and is non-deductible. Improvements add to basis dollar-for-dollar. Keep a running spreadsheet from year one.
- All selling costs reduce amount realized. Agent commission, transfer tax, title insurance, recording fees, attorney fees, and in many interpretations staging and prep costs. Don’t miss any.
- Time the sale across tax years. If your gain pushes you into the 20% LTCG bracket but next year you’ll be in the 15% bracket (retirement, sabbatical), defer.
- Convert to rental, then 1031 exchange. A primary residence doesn’t qualify for §1031 — you must convert to a bona fide rental first. Best practice: rent at FMV to an unrelated tenant for at least 2 years and document investment intent (Rev. Proc. 2008-16 safe harbor for the OUTBOUND side is also 2 years). Note the trade-off: extending the rental period eventually breaks the Section 121 use test (2 of 5 years), so you typically choose ONE strategy or the other. There’s a narrow window where a partial 121 + 1031 combo works (Rev. Proc. 2005-14) but it requires careful planning. See the 1031 exchange step-by-step guide.
- Installment sale. If you seller-finance, you spread the gain over the years payments arrive. Rare; doesn’t apply to most sellers.
- Charitable remainder trust. For very high gains ($1M+), a CRT can defer and partly eliminate tax. Talk to a tax attorney; the complexity isn’t worth it under that level.
The “moved out, still own” scenario
You moved out of your primary residence and now rent it. The Section 121 clock keeps ticking. Practically, you have just under 3 years from when you moved out to close the sale while still meeting the use test (used as primary 2 of the last 5 years).
Sell at year 2.5 of being out: still qualifies (you used it 2.5 of the last 5 years).
Sell at year 3.5 of being out: doesn’t qualify (only 1.5 of the last 5 used as primary).
Two important nuances people miss:
- Recapture still applies for the rental period, even if Section 121 covers the rest of the gain. Up to 25% federal on the depreciation taken or allowable.
- The post-2008 nonqualified use rule generally does NOT bite here — rental periods AFTER your last use as primary aren’t treated as nonqualified use. So the gain (less recapture) is fully excludable up to the cap if you sell in time.
If you’re in this situation and the appreciation is meaningful, the 3-year deadline is real money. Don’t miss it.
Common mistakes
- Not tracking capital improvements. The biggest avoidable loss. Fifteen years from now you won’t remember what you spent on the kitchen. Keep a folder, with receipts.
- Ignoring depreciation recapture on previously-rented homes. Many sellers find out at filing.
- Missing the partial exclusion. Sub-2-year sales for qualifying reasons get pro-rated relief. People miss this.
- Skipping a CPA on a high-gain sale. A few thousand in CPA fees routinely saves tens of thousands. On a $200k tax bill, you cannot afford to wing this.
- Confusing federal and state. Many states tax cap gains as ordinary income (CA, OR, MN, NJ, NY). A handful have no state income tax at all (FL, TX, NV, SD, WY, AK, TN; NH and WA tax investment income only in limited form — WA has a 7% cap gains tax above ~$270k that does NOT apply to real estate, but check current law). Run the state number too.
- Forgetting Form 8949 / Schedule D filing. Even if Section 121 fully excludes the gain, you generally must report the sale if you receive a Form 1099-S. Title companies routinely issue them.
- Reporting on the wrong year. The taxable year is the year of CLOSING, not the year of contract.
Tools you’ll use
- Capital Gains — model your specific gain and exclusion
- Seller Net Sheet — net proceeds before tax
- Sell vs Rent — rental conversion math
- 1031 Exchange — defer the gain via like-kind exchange
- Mortgage Calculator — payment math on the next home
Related reading: pricing your home, negotiating offers, and the 1031 exchange step-by-step.