Tax Guides

Home Sale Exclusion

Learn how to exclude up to $250,000 or $500,000 of gain on the sale of your main home, the ownership and use tests, partial exclusions and how to report it.

Reviewed October 2026 · Plain-language guide

Selling a home can create a large taxable gain, but many homeowners pay no federal tax on the sale. If the home was your main home and you meet the tests, you can exclude up to $250,000 of gain, or $500,000 if you are married and file jointly. This guide explains the tests, the exceptions, the situations that reduce the exclusion and how to report the sale.

The basic tests

To claim the full exclusion you must meet all of these:

  1. Not disqualified. The home was not acquired in a like-kind exchange during the past 5 years, and you are not subject to expatriate tax.
  2. Ownership. You owned the home for at least 24 months of the 5 years before the sale. For a joint return, only one spouse must meet this test.
  3. Residence. You used it as your main home for at least 24 months (730 days) of that 5-year period. The months do not have to be consecutive, and short absences like vacations count as time at home. For a joint return, each spouse must meet the residence test to get the full $500,000.
  4. Look-back. You did not exclude gain from another home sold during the 2 years before this sale.

The exclusion applies only to your main home. If you own more than one home, the IRS looks at facts such as where you spend the most time, your address on tax returns, driver's license and voter registration, and where you work and bank.

Special situations

  • Divorce. If your former spouse is allowed to live in the home under a divorce or separation instrument, you can still treat it as your residence.
  • Surviving spouse. If you sell within 2 years of your spouse's death and have not remarried, you may still use the $500,000 exclusion if the other conditions are met, counting time your late spouse owned and lived in the home.
  • Military, Foreign Service, intelligence community and Peace Corps. You may suspend the 5-year test period for up to 10 years while on qualified official extended duty.
  • Care facility. Time in a licensed care facility can count toward the residence test if you lived in the home for at least 12 months of the 5 years and became unable to care for yourself.

Partial exclusion

If you do not meet the 2-year tests, you may still exclude part of the gain if the main reason for the sale was a change in work location (a new job at least 50 miles farther from the home than your old workplace), a health-related move, or certain unforeseeable events. The exclusion is prorated by the part of the 24 months you met the tests.

Example 1: Alex, who is single, lived in his home for 15 months before his employer transferred him 80 miles away. Alex sells at a gain of $200,000. His reduced exclusion is 15/24 x $250,000 = $156,250, so $43,750 of the gain is taxable.

Example 2: A married couple filing jointly bought a home for $300,000 in 2015 and spent $50,000 on a new kitchen and roof. They sell it in 2026 for $850,000 and pay $51,000 in selling costs. Their gain is $799,000 - $350,000 = $449,000, which is under the $500,000 limit, so none of the gain is taxable.

Rental use, home offices and depreciation

If you rented out the home or used part of it for business, you may need to adjust the exclusion:

  • Depreciation. You cannot exclude gain equal to depreciation you took, or were allowed to take, after May 6, 1997. That gain is taxed, often at a maximum rate of 25%. See rental property taxes.
  • Nonqualified use. For periods after 2008 when the home was not your main home, such as when it was a rental or second home, a proportionate share of the gain may not be excludable. Exceptions include any part of the 5-year period after the last date you used it as your main home, qualified official extended duty, and temporary absences of up to 2 years in total for a job change, health condition or other unforeseen circumstance.
  • Separate business space. Gain on a separate part of the property used for business may be taxable.

Reporting the sale

Real estate settlement agents often send Form 1099-S showing the gross proceeds. You must report the sale on Form 8949 and Schedule D if you have a taxable gain, if you received a Form 1099-S (even when none of the gain is taxable), or if you choose to report a gain that could have been excluded. If none of those is true, you do not need to report the sale. A loss on the sale of your personal home is not deductible.

Your gain is the sale price minus selling costs minus your basis. Basis is what you paid, plus certain closing costs and improvements that add value, such as a new roof or addition. Routine repairs do not count. Keep these records until 3 years after the due date of the return for the year of sale. See how long to keep tax records.

Gain above the exclusion is capital gain taxed at the long-term rates in capital gains and losses, and may be subject to the net investment income tax. A foreclosure or short sale is also treated as a sale and can create canceled-debt income; see cancellation of debt. For property in India, see selling property in India.

State considerations

Illinois starts from federal adjusted gross income, so a gain that is excluded federally is generally not taxed by Illinois. Gain you must report federally is taxed at the flat Illinois rate. See our Illinois guide.

How we can help

We check the ownership and use tests, build your basis from closing statements and improvement records, and prepare the reporting. See tax planning or contact us.

Frequently asked questions

Can I use the exclusion more than once?

Yes, but generally only once every 2 years, and each sale must meet the tests.

What if I lived in the home for less than 2 years?

You may qualify for a partial exclusion if the main reason was a job move, a health issue or an unforeseeable event.

Does the exclusion apply to a second home or vacation home?

No. It applies to your main home only.

Do I report a home sale if all of the gain is excluded?

If you received Form 1099-S, yes. Otherwise, you generally do not need to report a sale when all of the gain is excluded.

Official sources

This page is a plain-language summary. The official source controls if there is any difference.

General information only, not tax, legal or accounting advice for your situation. Rules, limits and deadlines change; confirm the current rules with the official source or a qualified professional before you act. Reading this page does not create a professional relationship with CPA Tax Payroll and Accounting Corp.