Home Sellers

Capital Gains When Selling Your Home: The Section 121 Exclusion Explained

How the $250k/$500k home sale exclusion works, how to calculate your gain and cost basis, and the special rules for rentals, divorce, and partial exclusions.

Nesterfy Editorial June 26, 2026 12 min read intermediate

The home sale exclusion — Section 121 of the tax code — is one of the most generous tax breaks available to households: up to $250,000 of profit tax-free ($500,000 for married couples filing jointly) when you sell your primary residence. Most sellers owe nothing. But the mechanics matter, especially for long-held homes, former rentals, and high-appreciation markets.

The Two Tests

  • Ownership test: you owned the home for at least 2 of the 5 years before the sale
  • Use test: you lived in it as your primary residence for at least 2 of those 5 years (the 24 months need not be consecutive)

Married couples need both spouses to meet the use test (only one needs ownership) for the full $500,000. You can use the exclusion repeatedly over your lifetime, but generally not more than once every two years.

Calculating Your Actual Gain

Gain is not sale price minus purchase price. It's the amount realized (sale price minus selling costs like commissions and transfer taxes) minus your adjusted cost basis (purchase price + qualifying closing costs at purchase + capital improvements − any depreciation claimed, e.g., for a home office or rental period).

Counts Toward Basis (improvements)Doesn't Count (repairs/maintenance)
New roof, HVAC, water heaterFixing a roof leak, servicing the furnace
Kitchen or bath remodel, additionRepainting, replacing a broken faucet
New deck, fence, driveway, landscaping projectsLawn care, gutter cleaning
New windows, insulation, wiring, plumbing upgradesPatching drywall, replacing bulbs
Pro Tip

Keep a running folder (paper or digital) of every improvement receipt for as long as you own the home. On a long-held home in an appreciated market, documented improvements can be the difference between owing nothing and owing tax on tens of thousands above the exclusion cap.

Gain Above the Exclusion

Gain beyond $250k/$500k is a long-term capital gain, taxed at 0%, 15%, or 20% depending on your income, plus the 3.8% net investment income tax at higher incomes, plus state income tax where applicable. The exclusion thresholds are not indexed to inflation — in high-appreciation markets, ordinary families increasingly exceed them, which makes basis documentation more valuable every year.

Special Situations

  • Partial exclusion: if you sell early due to a job relocation (50+ miles), health reasons, or qualifying unforeseen events, you get a prorated exclusion — e.g., 12 months of residence = 50% of the cap
  • Former rental converted to residence: gain attributable to 'nonqualified use' periods after 2008 isn't excludable, and depreciation you claimed while renting is always recaptured at up to 25%
  • Residence converted to rental: sell within 3 years of moving out and you can still pass the use test
  • Divorce: a spouse who receives the home in divorce can count the ex-spouse's ownership period; use tests have accommodations
  • Widowed sellers: may use the full $500,000 exclusion if the sale closes within 2 years of the spouse's death
  • Home office: depreciation claimed for a home office within the same dwelling is recaptured, but the space still qualifies for the exclusion
Warning

This is education, not tax advice. If your gain approaches the exclusion caps, the home spent any time as a rental, or a divorce/death/relocation is involved, spend an hour with a CPA before you list — the planning options mostly disappear once you've sold.

Reporting

If you receive Form 1099-S from the closing (common), report the sale on your return even if fully excluded. No 1099-S and fully excluded gain generally means no reporting requirement — but keep your closing statements and basis records for at least 3 years after the return, and ideally much longer.

Key Points

Two years of ownership and use unlocks $250k/$500k of tax-free gain. Your job as a seller is paperwork: document improvements, keep closing statements, and get professional help when rentals or partial exclusions enter the picture.

Related Articles