Capital Gains Tax When You Sell Your Home

How the home sale exclusion lets many sellers avoid tax on up to 250,000 or 500,000 dollars of gain, the ownership and use tests, and when gain is still taxable.

Selling your home can produce a large profit, and the IRS treats that profit as a capital gain. The good news is that a tax break called the home sale exclusion lets most sellers keep all or most of that gain tax-free. This guide explains how the exclusion works, who qualifies, how to calculate your gain, and the mistakes that cost sellers money.

How the home sale exclusion works

If you sell your main home at a profit, you can exclude up to $250,000 of that gain from your income. Married couples filing a joint return can exclude up to $500,000. Any gain above your exclusion amount is taxable. Gain below the limit is not reported as income at all, assuming you meet the qualifying tests below. For the full set of rules, see the IRS overview at Topic No. 701, Sale of Your Home.

Do you qualify? The ownership and use tests

To claim the exclusion, you must pass two tests during the five years leading up to the sale:

  • Ownership test: You owned the home for at least 2 years.
  • Use test: You lived in the home as your main home for at least 2 years.

The 2 years do not have to be continuous. You can move out and move back in, and short absences still count as time lived in the home. The two tests also do not have to cover the same 24-month period. You only need to total 2 years of ownership and 2 years of use within the 5-year window.

For a joint return, the rules split the tests between spouses. Either spouse can meet the ownership test, but both spouses must meet the use test to claim the full $500,000 exclusion.

The frequency limit

You generally cannot use the exclusion if you already excluded gain from selling another home within the 2 years before this sale. This stops sellers from claiming the break repeatedly on a string of quick sales. If you sold a previous home and excluded the gain 18 months ago, you would not qualify for a full exclusion on a sale today.

Figuring your gain and your basis

Your taxable gain is not simply the sale price minus what you originally paid. The number that matters is your basis. Basis equals your purchase price plus the cost of improvements you made over the years. Improvements include things like a new roof, an addition, or a remodeled kitchen. Routine repairs do not count.

A higher basis means a lower gain, which means less tax. Keeping records of every improvement directly reduces what you might owe. Your gain is the selling price minus selling costs minus your adjusted basis. The IRS walks through this calculation in detail in Publication 523, Selling Your Home.

What happens to gain above the exclusion

If your gain exceeds your exclusion amount, the excess is taxed as a capital gain. When you owned the home more than a year, that excess qualifies for long-term capital gains rates, which are lower than ordinary income rates. The long-term rates are 0%, 15%, or 20%, depending on your taxable income. For 2025, the 0% rate applies to taxable income up to $48,350 for single filers and $96,700 for married couples filing jointly. Income above those thresholds pushes the gain into the 15% or 20% brackets. See Topic No. 409, Capital Gains and Losses for the rate details.

Worked example

Suppose a married couple bought their home for $400,000. Over 12 years they spent $60,000 on a kitchen remodel and a new roof. Their adjusted basis is:

  • Purchase price: $400,000
  • Plus improvements: $60,000
  • Adjusted basis: $460,000

They sell the home for $1,050,000 and pay $50,000 in real estate commissions and closing costs. Their gain is:

  • Sale price: $1,050,000
  • Minus selling costs: $50,000
  • Amount realized: $1,000,000
  • Minus adjusted basis: $460,000
  • Total gain: $540,000

Because they file jointly and pass both tests, they exclude $500,000 of that gain. The remaining $40,000 is a long-term capital gain. If their taxable income places them in the 15% bracket, they owe $6,000 on the sale. Without tracking the $60,000 in improvements, their gain would have been $600,000, leaving $100,000 taxable instead of $40,000. The records saved them tax on $60,000 of gain.

Partial exclusion for early sales

If you sell before meeting the 2-year tests, you may still qualify for a partial exclusion in certain situations. This applies when the sale is driven by a change in your place of work, a health problem, or other unforeseen circumstances. The partial exclusion is prorated based on how long you owned and used the home. A couple forced to relocate for a job after living in the home only one year, for example, could exclude up to half the normal amount. Publication 523 explains how to calculate the reduced limit.

Common mistakes to avoid

  • Throwing away improvement records. Without receipts for improvements, you cannot add them to your basis, and your taxable gain looks larger than it really is.
  • Confusing repairs with improvements. Fixing a leak is a repair and does not raise basis. Replacing the entire roof is an improvement that does.
  • Assuming a rental or second home qualifies. The exclusion applies to your main home, not investment property or a vacation house you did not live in.
  • Forgetting the frequency limit. Selling two homes within two years can disqualify you from claiming the exclusion twice.
  • Not reporting the sale when required. If you receive a Form 1099-S, or if your gain exceeds the exclusion, you must report the sale on your return even if part of the gain is excluded.

Do I have to report the sale if all my gain is excluded?

Often no. If your entire gain is covered by the exclusion and you did not receive a Form 1099-S, you generally do not need to report the sale. If you did receive a 1099-S, report it. Publication 523 covers the reporting rules.

Can I exclude gain on a home I rented out?

Only if it was your main home and you meet the ownership and use tests. Time you rented the property can reduce your exclusion through rules on nonqualified use, and depreciation claimed during rental periods is taxed separately and cannot be excluded.

What counts toward the 2-year use test?

Time you actually lived in the home as your main residence. Short absences such as vacations count as time lived there. The 2 years do not need to be consecutive within the 5-year window before the sale.

Are selling costs deductible from my gain?

Yes. Real estate commissions, legal fees, and certain closing costs reduce the amount you realize from the sale, which lowers your gain. Keep settlement statements to document these costs.

What if my gain is larger than the exclusion?

The portion above your exclusion limit is taxable. If you owned the home more than a year, it is taxed at long-term capital gains rates of 0%, 15%, or 20% based on your taxable income. Review Topic No. 409 to see which rate applies to you.

Disclaimer: This article is for informational purposes only and is not meant to be financial or legal advice.

applause

0 comments

No comments yet. Be the first to comment.

articleRelated articles

arrow_backBack to articles