The basic rule
If you owned the home and used it as your main residence for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of gain from federal tax — $500,000 if married filing jointly. The two years need not be continuous, and you can use the exclusion again after two years. Gain above the cap is taxed at long-term capital gains rates.
Your gain is smaller than you think
Gain isn’t sale price minus purchase price. It’s amount realized (sale price minus selling costs like commission) minus adjusted basis (purchase price + capital improvements − depreciation). A new roof, an addition, a remodel — all raise your basis and shrink the taxable gain. This is why keeping receipts for improvements matters for decades.
Sold before two years? You may still qualify
A work relocation of 50+ miles, health reasons, or unforeseen circumstances (divorce, death, multiple births) unlock a partial exclusion, prorated by months: 14 qualifying months gets a single filer 14/24 × $250,000 ≈ $145,833. Many sellers — and many online calculators — wrongly assume it’s all-or-nothing.
The rental trap
If the home was ever a rental, depreciation you claimed (or were entitled to claim) is never excludable. It returns on sale as unrecaptured §1250 gain, taxed at up to 25%. Converting a rental back into your residence for two years does not erase this — a detail that surprises landlords every filing season.
When to get help
Inherited property, divorce transfers, home offices with claimed depreciation, or gains far above the cap — these deserve a professional, not a widget. The exclusion is generous, but the edge cases are where money is won or lost.