Selling your home
Capital Gains Tax on a House Sale: How the Home Sale Exclusion Works
Capital gains tax on a house sale: the IRS lets you exclude up to $250,000 of gain ($500,000 married filing jointly) if you meet the 2-out-of-5-year rule.

Short answer: Capital gains tax on a house sale applies only to gain the IRS doesn't let you exclude. If you sell your main home, you can exclude up to $250,000 of gain from your income, or up to $500,000 if you're married filing jointly. To qualify, you generally must have owned the home and lived in it as your main home for at least 2 of the 5 years before the sale. Gain above the exclusion is taxed as a capital gain.
How Much Capital Gains Tax Do You Pay on a House Sale?
If you're selling the home you live in, the answer depends on two numbers: how much gain you have, and whether you qualify for the home sale exclusion.
- If you qualify and your gain is under the limit, the gain is excluded from income. You may not even need to report the sale (see below).
- If your gain is over the limit, only the amount above $250,000 (or $500,000 for a joint return) is taxable.
- If you don't qualify, the full gain is generally taxable, unless you qualify for a partial exclusion.
The exclusion applies only to your main home. The IRS notes that gain on other homes, such as a second home, is taxable.
Who Qualifies for the $250,000 Home Sale Exclusion?
IRS Publication 523 sets out three main tests. You generally qualify for the full exclusion if you meet all of them:
- Ownership test. You owned the home for at least 24 months (2 years) out of the 5 years before the date of sale.
- Residence test. You lived in the home as your main home for at least 24 months during the same 5-year period. The months don't have to be a single block of time.
- Look-back test. You didn't take the exclusion on another home sale during the 2 years before this sale.
A single-family home, a condominium, a cooperative apartment, a mobile home and a houseboat can each be a main home. If you own or live in more than one home, the IRS applies a "facts and circumstances" test. The most important factor is where you spend the most time.
How Does the $500,000 Exclusion Work for Married Couples?
Married couples filing jointly can exclude up to $500,000. Only one spouse has to meet the ownership test, but each spouse must meet the residence test on their own.
There's also a rule for widows and widowers. A surviving spouse may count the late spouse's ownership and residence time and may still claim the $500,000 exclusion if the home is sold within 2 years of the spouse's death, the surviving spouse hasn't remarried, the 2-year ownership and residence tests are met, and neither spouse took the exclusion on another home sold in the previous 2 years.
How Do You Figure the Gain on Your Home?
Your gain is the amount realized minus your adjusted basis. In plain terms:
- Amount realized is the selling price minus your selling expenses.
- Adjusted basis generally starts with what you paid for the home. You add the cost of additions and improvements.
Improvements are work that adds to the value of your home, prolongs its useful life or adapts it to new uses, such as adding a bedroom or a deck, installing central air or putting on a new roof. Repairs and routine maintenance, such as painting or fixing leaks, generally don't add to basis.
Here's a hypothetical example using round numbers, not a typical result:
| Step | Single filer | Married filing jointly |
|---|---|---|
| Selling price | $700,000 | $700,000 |
| Minus selling expenses | −$40,000 | −$40,000 |
| Amount realized | $660,000 | $660,000 |
| Minus adjusted basis (purchase price $300,000 + improvements $50,000) | −$350,000 | −$350,000 |
| Gain | $310,000 | $310,000 |
| Minus exclusion | −$250,000 | −$310,000 (up to $500,000 allowed) |
| Taxable gain | $60,000 | $0 |
If you inherited your home, your basis is generally the fair market value of the property on the date of the previous owner's death. If an estate tax return (Form 706) was filed, the value listed on that return is your basis.
How Is the Taxable Part of the Gain Taxed?
Gain you can't exclude is a capital gain. If you owned the home for more than one year, it's generally a long-term gain. Gain on property held one year or less is short-term and is taxed as ordinary income.
For tax year 2026, the IRS's inflation adjustments (Rev. Proc. 2025-32) set these taxable income limits for the long-term capital gains rates:
| Filing status | 0% rate up to | 15% rate up to | 20% rate above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly or surviving spouse | $98,900 | $613,700 | $613,700 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
| Head of household | $66,200 | $579,600 | $579,600 |
The rate is based on your total taxable income, not just the gain. Two other rules can apply. If you claimed depreciation for a home office or rental use, you can't exclude the part of your gain equal to depreciation allowed or allowable after May 6, 1997, and the IRS taxes unrecaptured section 1250 gain at a maximum rate of 25%. Individuals with significant investment income may also owe the net investment income tax; IRS Topic No. 559 explains it.
How Can You Avoid or Reduce Capital Gains Tax on a Home You Live In?
There's no trick to it, but the rules themselves give you a few legitimate ways to keep the taxable gain down:
- Meet the 2-out-of-5-year rule. Timing a sale after you've owned and lived in the home for 24 months can make the difference between a fully taxable gain and an excluded one.
- Track improvements. Every qualifying improvement adds to your basis and lowers your gain.
- Check for a partial exclusion. If you have to sell early, you may qualify for a reduced exclusion when the main reason was a change in workplace location, a health issue or an unforeseeable event. For a work-related move, one example the IRS gives is a new job location at least 50 miles farther from the home than the old one.
- Know the service-member rule. Members of the uniformed services, the Foreign Service, the intelligence community and the Peace Corps on qualified extended duty may suspend the 5-year test period for up to 10 years.
If your gain is likely to be well above the exclusion, or you've rented out part of the home, a tax professional can help you work through Publication 523's worksheets.
Do You Have to Report the Sale of Your Home?
You must report the sale on your tax return if either of these is true:
- You received Form 1099-S, Proceeds From Real Estate Transactions, even if all of your gain is excludable.
- You can't exclude all of your gain.
When reporting is required, you use Form 8949 and Schedule D (Form 1040). If you exclude all of the gain and didn't receive Form 1099-S, you generally don't need to report the sale.
A loss on the sale of your main home isn't deductible. The IRS treats a home as personal-use property, and losses on personal-use property aren't tax deductible.
What Should Retirees and Downsizers Keep in Mind?
If selling your home is part of your retirement plan, a few points are worth keeping in mind:
- Add up your improvements before you list. Every documented improvement adds to your basis and lowers your gain.
- The taxable part counts as income. Any gain above the exclusion adds to your taxable income for the year, which affects which capital gains rate applies.
- Weigh your options. If you'd rather stay put and tap your equity, our guide to reverse mortgage pros and cons explains how that option works, and the mortgage payment calculator can estimate the payment on your next home.
Your home sale proceeds are also a chance to revisit your retirement income plan. Our guide to when to claim Social Security covers another big timing decision, and if you want help, here's what a financial adviser costs.
The Bottom Line
If you sell your main home after owning and living in it at least 2 of the last 5 years, you can generally exclude up to $250,000 of gain, or $500,000 on a joint return. Gain above that is taxed at long-term capital gains rates if you owned the home for more than a year. Keep records of every improvement, check whether you'll receive Form 1099-S, and use IRS Publication 523 to figure your exact numbers.
FinancialAdviser.com is not a tax preparer and nothing here is tax advice. Tax rules can change; check IRS Publication 523 or ask a tax professional about your situation.
Frequently asked questions
Do you pay capital gains tax when you sell your house?
Only on gain above the exclusion, if you qualify for it. The IRS lets you exclude up to $250,000 of gain on the sale of your main home, or up to $500,000 on a joint return, if you meet the ownership and use tests. Gain above that amount, or gain that doesn't qualify, is taxable.
What is the 2-out-of-5-year rule?
To claim the full exclusion, you must have owned the home for at least 24 months and lived in it as your main home for at least 24 months during the 5 years before the sale. The months don't have to be in a single block.
Do I have to report the sale of my home to the IRS?
You must report the sale if you received Form 1099-S or if you can't exclude all of your gain. If neither applies, you generally don't need to report it. When reporting is required, you use Form 8949 and Schedule D (Form 1040).
Can I deduct a loss on the sale of my home?
No. The IRS says losses from the sale of personal-use property, such as your home or car, aren't tax deductible.
What if I have to sell before living there for 2 years?
You may qualify for a partial exclusion if the main reason for the sale was a change in workplace location, a health issue or an unforeseeable event. IRS Publication 523 explains how to figure the reduced amount.
Sources
- IRS: Topic No. 701, Sale of Your Home
- IRS: Publication 523, Selling Your Home
- IRS: Topic No. 409, Capital Gains and Losses
- IRS: Internal Revenue Bulletin 2025-45 (Rev. Proc. 2025-32, 2026 inflation adjustments)
- IRS: Important Tax Reminders for People Selling a Home
This guide is general information, not personal advice. Your situation may differ, so consider talking with a qualified professional, such as a fiduciary financial adviser, CPA or licensed agent, before making a decision.


