Most US homeowners pay no federal capital gains on sale of home profits, because Section 121 of the tax code lets you exclude up to $250,000 of gain, or $500,000 if you’re married and file jointly. To qualify, you generally need to have owned the home and lived in it as your main home for at least two of the five years before the sale, and you can’t have used the exclusion on another home in the previous two years. Gain above the limit is taxed as a capital gain.
Here’s how the IRS Publication 523 tests work, how to figure your gain, and where homeowners get caught out.
The ownership and use tests
The IRS applies two separate tests, and you need to pass both within the five-year period that ends on the sale date.
- Ownership test: you owned the home for at least 24 months in the last five years.
- Use test: you lived in it as your main home for at least 24 months in the last five years.
The two years don’t have to be continuous, and they don’t have to overlap. You could rent a house for two years, buy it, live in it for another year, and still pass both tests once you’ve owned it for two years.
There’s also a look-back rule: you can take the exclusion only once in any two-year period. If you sold another home in the two years before this sale and excluded gain on it, you generally can’t exclude gain on this one too.
When married couples get the full $500,000
The $500,000 limit isn’t automatic for couples. Per Publication 523, you need all of the following:
- You file a joint return for the year of the sale.
- At least one spouse meets the ownership test.
- Both spouses meet the use test.
- Neither spouse excluded gain on another home sale in the prior two years.
If only one spouse qualifies, the couple can usually still exclude up to $250,000.
How to calculate capital gains on sale of home
Your gain is the amount realized minus your adjusted basis. The amount realized is the sale price minus selling expenses such as agent commissions, advertising and legal fees. Your basis starts with the purchase price and grows with two things:
- Certain purchase closing costs, such as abstract fees, legal fees for the title search and contract, recording fees, survey fees, transfer taxes and owner’s title insurance. Loan-related charges like points and credit report fees don’t count, and neither do fire insurance premiums. Our guide to closing costs in the United States breaks down which fees typically show up on your settlement statement.
- Improvements that add value, extend the home’s life or adapt it to new uses: a new roof, an addition, a kitchen remodel. Routine repairs and painting don’t count unless they’re part of a larger remodeling project.

A worked example with real numbers
Dana and Luis bought their house in 2014 for $410,000 and lived in it the whole time. They file jointly and sell in 2026 for $1,150,000.
| Item | Amount |
|---|---|
| Sale price | $1,150,000 |
| Minus selling costs (commission, fees) | $62,000 |
| Amount realized | $1,088,000 |
| Purchase price | $410,000 |
| Plus eligible purchase closing costs | $6,500 |
| Plus improvements (new roof, kitchen) | $85,000 |
| Adjusted basis | $501,500 |
| Gain ($1,088,000 minus $501,500) | $586,500 |
| Exclusion (married filing jointly) | $500,000 |
| Taxable long-term capital gain | $86,500 |
Without their improvement records, basis would drop to $416,500 and the taxable gain would climb to $171,500. That’s why the paperwork is worth keeping for as long as you own the home.
Partial exclusion if you move early
If you fail the two-year tests because of a job change, health reasons or an unforeseeable event, you may still get a reduced exclusion. Publication 523 counts a work move if your new job is at least 50 miles farther from the home than your old job was. Health moves include relocating for diagnosis or treatment, or on a doctor’s recommendation. Unforeseeable events include death, divorce or legal separation, the home being destroyed or condemned, multiple births from one pregnancy, and becoming eligible for unemployment compensation.
The math: take the shortest of your time living there, your time owning it, or the time since your last excluded sale, divide by 24 months, and multiply by $250,000. A single owner who lived in a home for 14 months before a qualifying job move gets 14 / 24 x $250,000 = $145,833. If the gain is $90,000, it’s fully covered.
Rentals, home offices and depreciation recapture
If you rented the home or claimed a home office and took depreciation after May 6, 1997, that depreciation can’t be excluded. It’s taxed when you sell as unrecaptured Section 1250 gain, at a maximum federal rate of 25%, according to IRS Topic 409. Separately, periods after 2008 when the home wasn’t your main residence can count as nonqualified use, which can reduce the exclusion. If you plan to turn a former home into a rental, run the numbers in our rental cash flow calculator with this tax in mind.
Form 1099-S and reporting the sale
The closing agent may issue Form 1099-S, which reports your gross proceeds to the IRS. According to IRS Topic 701, if you receive a 1099-S you must report the sale on your return even if the whole gain is excluded. You also report it if part of the gain is taxable, using Form 8949 and Schedule D. A loss on your personal home isn’t deductible.
Has the $250,000/$500,000 limit changed?
No. The limits have not been raised. Several bills have been introduced in Congress, including the More Homes on the Market Act, which would raise the limits to $500,000 and $1 million, and the No Tax on Home Sales Act, which would remove the tax on main-home sales entirely. As of November 2026 these are proposals only and have not passed. Plan your sale under the current rules.
Quick questions
Do I have to buy another home to avoid the tax?
No. Section 121 doesn’t require a replacement home. The exclusion applies whether you buy again, rent or move in with family.
Does the 1099-S mean I owe tax?
Not necessarily. It only means the sale was reported to the IRS. You still report the sale, and the exclusion can bring the taxable amount to zero.
Related tools: Closing Costs Calculator · Rent vs Buy Calculator · Rental Cash Flow Calculator · All tools & checklists
Sources: IRS Publication 523, Selling Your Home; IRS Topic 701, Sale of Your Home; IRS Topic 409, Capital Gains and Losses. Checked November 9, 2026.
This article is general information, not financial, tax or legal advice. For a sale with rental use, a home office or a partial exclusion, talk to a CPA or enrolled agent.

