For most households, the home is the largest appreciated asset they will ever sell — and the tax code treats its sale more generously than any other. Under Internal Revenue Code §121, a single seller can exclude up to $250,000 of capital gain on a principal residence, and a married couple filing jointly can exclude up to $500,000, provided the ownership and use tests are met. Gain above the exclusion is taxed as capital gain; gain inside it is simply not taxed at all — it does not even need to be reported as income beyond the sale reporting itself. The exclusion is large enough that most sellers owe nothing, which is exactly why the ones who do owe — long-tenure owners in high-appreciation markets, and sellers who miss a test by a few months — benefit from understanding the mechanics before the closing date is set.
The two tests: ownership and use
Both tests look at the five years ending on the sale date. The ownership test requires that you owned the home for at least two of those five years. The use test requires that you lived in it as your main home for at least two of those five years. The two periods do not have to be the same two years, and they do not have to be continuous — two years is measured as 24 full months or 730 days in total. For a married couple claiming the full $500,000, both spouses must meet the use test and at least one must meet the ownership test, and neither spouse may have used the exclusion on another sale within the previous two years. That last condition is its own rule: the exclusion is available at most once every two years, no matter how cleanly the tests are met. One more structural limit: if part of the property was used for rental or business after 2008, the gain attributable to those periods of "nonqualified use" is carved out and cannot be excluded, and any depreciation you claimed on the property is recaptured as income rather than excluded.
The arithmetic, on one sale
Gain is not the sale price. It is the amount realized (sale price minus selling expenses such as commissions) minus your basis (what you paid, plus closing costs at purchase, plus the cost of improvements — additions, a new roof, a kitchen remodel — but not repairs and maintenance). Example: a couple bought for $280,000 and spent $20,000 on improvements over the years, for a basis of $300,000. They sell for $620,000 and pay $30,000 in commissions and selling costs, realizing $590,000. Their gain is $590,000 − $300,000 = $290,000. Filing jointly with both tests met, the full $290,000 sits inside their $500,000 exclusion: federal tax on the sale is $0. A single seller with the identical numbers excludes $250,000 and owes capital-gains tax on the remaining $40,000 — at the 15% bracket that is $6,000, plus the 3.8% net investment income tax if their income is high enough to trigger it, plus whatever their state charges. The example shows why basis records matter: every documented improvement dollar is a dollar of gain that never gets taxed, exclusion or no exclusion, which is the same stepped-up-basis logic that governs inherited property in Inheriting a House.
Partial exclusions: when life shortens the two years
Sellers who meet neither test in full are not necessarily shut out. If the sale's primary reason is a change in place of employment, a health reason, or unforeseen circumstances (the regulations list events such as divorce, death, job loss, and multiple births from one pregnancy), a partial exclusion is available, prorated by the shorter of the time you owned and used the home or the time since your last exclusion sale, measured against 24 months. Sell after 12 qualifying months because a job moved you across the country, and a single seller's exclusion is 12/24 of $250,000 = $125,000; a couple's is $250,000. Safe-harbor distances and documentation are spelled out in the regulations — an employment change qualifies automatically if the new workplace is at least 50 miles farther from the home than the old one was. The partial exclusion is the rule that rewards checking the calendar before listing: a sale three months later, or a reason documented properly, can be worth five figures.
Where sellers get surprised
Three recurring cases. The converted rental: moving back into a former rental does not erase the nonqualified-use carve-out for the rental years after 2008, and the depreciation recapture is taxed regardless of the exclusion. The second-home promotion: a vacation home becomes excludable only after it becomes your main home and the use test runs — and the post-2008 nonqualified-use rule taxes the gain from the years before the conversion. The quick second sale: using the exclusion and then selling another home 18 months later yields no exclusion at all, partial rules aside. All three are manageable with timing and records, and all three are expensive when discovered on a draft tax return. The exclusion also sits inside the wider capital-gains picture — rates, brackets, and harvesting — covered in Capital Gains Management: The 0% Bracket, Gain Harvesting, and NIIT, and state treatment varies: most states follow the federal exclusion, but the conformity is not universal, so the state return deserves its own check.
Reporting the sale, and keeping the records
If you receive a Form 1099-S for the sale — most closings generate one — the sale must appear on your return (Form 8949 and Schedule D) even when the exclusion wipes the tax to zero; an unreported 1099-S invites an IRS notice proposing tax on the entire proceeds, because the IRS sees the gross amount, not your basis. If no 1099-S is issued and the exclusion covers the whole gain, reporting is generally not required. Either way, keep the closing statements from both the purchase and the sale, and the receipts for every improvement, for at least three years after the return for the sale year is filed — basis is the number you may one day have to prove, and it is assembled from exactly those papers. Sellers whose gain will clearly exceed the exclusion should also plan for estimated tax on the taxable portion rather than meeting it the following April.
Official documentation and references
- IRS Topic No. 701 — Sale of Your Home: the $250,000 / $500,000 exclusion and the ownership and use tests, summarized by the IRS
- IRS Publication 523 — Selling Your Home: the full rules, including partial exclusions, nonqualified use, and basis worksheets
Keep going
- Capital Gains Management: The 0% Bracket, Gain Harvesting, and NIIT
- Inheriting a House: Stepped-Up Basis, Three Options, the Tax on Each
- Rent vs. Buy: The Full Math, Including the Years Renting Wins
- General Retirement Calculator
Educational disclaimer: This article is general education, not personalized financial, tax, legal, or benefits advice. Primary sources, plan documents, and — for insurance and estate topics — your state's law and licensed professionals govern your situation. All numbers in examples are illustrative.