For most households, a home is the largest asset they will ever own, and when they sell it for far more than they paid, the natural fear is a giant tax bill on the profit. The reassuring reality: the tax code carves out one of its most generous exclusions specifically for selling your home, and the majority of sellers walk away owing nothing on the gain.

Section 121 home-sale exclusion: $250,000 for single filers, $500,000 for married couples, with the two-of-five-years test
Most people who sell a primary home pay no tax on the gain. Here is the size of the shield.

The Section 121 exclusion

Under Section 121 of the tax code, you can exclude a large chunk of the capital gain on the sale of your primary residence from tax entirely:

  • $250,000 of gain if you file single.
  • $500,000 of gain if you are married filing jointly.

This is gain, not sale price. If you bought a home for $300,000 and sold it for $700,000, your gain is roughly $400,000 — a married couple would owe nothing, and a single filer would owe long-term capital-gains tax only on the $150,000 above their $250,000 shield. Anything above the exclusion is taxed at long-term capital-gains rates, which are gentler than ordinary rates; the difference is explained in Capital Gains vs Ordinary Income Tax.

The ownership-and-use test

To claim the full exclusion, you must pass a two-part test — and crucially, the two parts do not have to overlap:

  • Ownership — you owned the home for at least 2 of the last 5 years before the sale.
  • Use — it was your primary residence for at least 2 of the last 5 years.

You also generally cannot have used the exclusion on another home sale in the past two years. The two-year clock is why this break applies to a home you actually live in, not a property you flip in a few months — a quick flip produces a fully taxable gain, often at the higher short-term rate.

Partial exclusions for life changes

If you fall short of two years because of a qualifying reason — a job relocation, a health issue, or certain unforeseen circumstances — you may still claim a prorated exclusion. Sell after living there one year for a new job, and a single filer might shield around $125,000 rather than the full $250,000. The point is that life events do not automatically cost you the entire break.

Why keeping improvement records matters

Your taxable gain is sale price minus your cost basis, and a higher basis means a lower gain. Your basis is not just the purchase price — it grows with the cost of capital improvements: a new roof, an addition, a kitchen remodel, a finished basement, new windows. Routine repairs do not count, but lasting improvements do.

For most owners the exclusion is so large that basis tracking never matters. But for long-held homes in expensive markets where the gain might exceed $250,000 or $500,000, every documented improvement directly lowers the taxable amount. Keep receipts, contracts, and records of major work for as long as you own the home plus a few years after you sell. This same idea — knowing what you actually paid into an asset — is covered in The True Cost of Homeownership.

Special situations to watch

  • Home offices and rentals — if you depreciated part of the home for business or rented it out, some gain (the depreciation portion) may be taxable even within the exclusion.
  • Inherited homes — these get a "stepped-up" basis to the value at the date of death, which usually wipes out gain on a quick sale; different rules entirely.
  • Second homes and investment properties — Section 121 does not apply; the gain is fully taxable.

Plan the sale, not just the move

If you are near the exclusion limit or your situation is unusual, a little planning before you list can save real money — sometimes waiting a few months to clear the two-year mark changes the entire bill. Weigh the move itself against renting with Rent vs Buy: The Real Math, and pressure-test the numbers with the Buy vs Rent Calculator and the Tax Health assessment before you sell.