Ask most sellers what happens to the money when a home sells and they will describe the exclusion correctly: up to $250,000 of gain is tax-free for a single filer, up to $500,000 for a married couple filing jointly. What they usually cannot describe is why the IRS calls it an exclusion rather than an exemption, or what has to be true about their own ownership before that number applies to them at all.
The rule, stated the way the IRS actually states it
Section 121 of the tax code lets you exclude gain from the sale of your main home if you pass two separate tests during the five years ending on the date of sale. The ownership test: you owned the home for at least 24 months (they do not have to be consecutive) within that five-year window. The use test: you lived in it as your main home for at least 24 months within the same window — also not required to be consecutive, and not required to be the same 24 months as the ownership period. Meet both and a single filer excludes up to $250,000 of gain; a couple filing jointly excludes up to $500,000. There is one more condition that catches people who sell often: you cannot have excluded gain on another home sale within the two years before this one.
Married filing jointly is not automatic
The $500,000 number gets treated as a couple's number. It is not quite. To claim the full $500,000, both spouses must independently meet the use test — each must have lived in the home for 24 of the last 60 months. Only one spouse needs to meet the ownership test. So a couple where one spouse bought the home eight years ago and the other moved in fourteen months ago, then got married and sold, does not get $500,000. One spouse fails the use test, and the couple is capped at $250,000 — even filing a joint return.
There is a specific carve-out for divorce that runs the other direction. If a divorce or separation instrument grants your former spouse the right to live in the home, you are treated as using the home during the period your former spouse actually lives there, even though you moved out. It is a narrow provision, and it is the reason a spouse who left the house years before the sale can still qualify.
“Gain” is not the sale price minus what you paid
The exclusion applies to gain, and gain is not intuitive arithmetic. Your adjusted basis is what you paid for the home, plus qualifying capital improvements over the years you owned it (a new roof, an addition, a kitchen remodel — not routine repairs or maintenance), minus any depreciation you have claimed against the property. Your gain is the price you sold for, minus selling costs, minus that adjusted basis.
| Item | Amount |
|---|---|
| Purchase price (2016) | $300,000 |
| + Qualifying capital improvements | $40,000 |
| = Adjusted basis | $340,000 |
| Sale price (2026) | $950,000 |
| − Selling costs (commission, transfer tax, title) | $50,000 |
| = Net sale proceeds | $900,000 |
| Gain (net proceeds − adjusted basis) | $560,000 |
That $560,000 gain is the number the exclusion actually gets applied to — and it is where filing status stops being a formality and starts being real money.
The depreciation you forgot you took
If you ever claimed a home-office deduction, or rented the property out before moving back in, you likely claimed depreciation against it. The exclusion does not cover that portion of the gain. Any depreciation allowed or allowable after May 6, 1997 has to be recaptured — it becomes unrecaptured Section 1250 gain, taxed at a maximum federal rate of 25%, instead of the 0%, 15%, or 20% long-term capital gains rates that apply to the rest. A homeowner who deducted a home office for six years, then sold, cannot exclude the depreciation deductions they took — only the remaining gain qualifies.
A related trap sits in what the IRS calls non-qualified use: periods after 2008 when the home was a rental or second home rather than your main residence, occurring before the final stretch you lived in it, can prorate your exclusion downward even if you otherwise pass both tests. It rewards people who convert a rental into a primary residence and then sell quickly, and penalizes people who do the reverse.
When you don't clear the two years — partial exclusion
If you sell before meeting the ownership or use test, you are not automatically stuck paying full tax on the gain. A partial exclusion is available if the primary reason for the sale was a change in place of employment (your new job is at least 50 miles farther from the home than your old one was), health (moving to obtain or provide medical care), or an unforeseen circumstance — death, divorce or legal separation, multiple births from the same pregnancy, a casualty or natural disaster affecting the home, or an inability to pay basic living expenses.
The partial exclusion is prorated: take the shorter of the time you owned the home, used it, or the time since your last exclusion, in days, divide by 730, and multiply by the full exclusion amount. A single filer who lived in a home for 14 months before an employer-mandated transfer 220 miles away can exclude roughly 14/24 of $250,000 — about $145,833. Gain above that is taxable.
Why the fine print doesn't surface until closing
None of this is hidden. It is all in Publication 523. It stays invisible in practice because the headline number is so clean that it discourages the follow-up questions: nobody tracks a decade of capital-improvement receipts expecting to need them, a two-year rental stretch a while back gets forgotten by the time the home sells, and a new spouse's move-in date feels irrelevant until it determines whether the exclusion is $250,000 or $500,000. The rule rewards sellers who reconstruct their own basis and occupancy history before they sign a listing agreement, not after the wire hits their account.
The two-year reset that resets nothing. Passing the ownership-and-use test does not create a standing exemption. Every sale is evaluated on its own, and using the exclusion on one home locks you out of using it again on a different home for two years — a real constraint for anyone selling an investment property and a residence in close succession.