Skip to content

General education, not advice for your situation.

Carry Forward Learning Start here Intern0 XP

Article · Property

Selling your home: how the home-sale exclusion works

The section 121 home-sale exclusion in plain words: ownership and use tests, the joint limit, partial exclusions, depreciation and when to report the sale.

By the Carry Forward Learning team Reviewed by Hunter Nottingham, JD, CPA

Checked Review by

CheckedOct 19, 2026

The carry forward

Count the gain, not the price, and check both tests on the calendar before you list the house.

For most people, the biggest gain they will ever have is on the house they live in. The tax law is unusually generous about it. If you meet a few tests, a large piece of that gain is simply left out of your income, and for many sellers that means no tax on the sale at all. The tests are where people trip, so this page goes through them one at a time: the dollar limits, the ownership and use tests, how often you can use it, the partial exclusion when life forces an early move, and the two things the exclusion never covers.

The limits

If you qualify, you can exclude up to $250,000 of gain from the sale of your main home. On a joint return, the limit is $500,000. 1

Two words in that sentence do a lot of work. Gain, not sale price: the exclusion applies to what you sold for, less selling costs, less your basis (what you paid plus improvements). And main home: the place you actually live most of the time, not a vacation house or a rental you never lived in.

The two tests: ownership and use

To get the full exclusion, you generally need both. 2

Ownership. You owned the home for at least 24 months out of the 5 years before the sale. 2

Use. You lived in the home as your main home for at least 24 months out of the same 5 years. 2 Publication 523 puts the use test at 730 days, and the time does not have to be continuous. 1

The two periods do not have to be the same months, as long as both fall inside the 5 years ending on the date of sale. 2 So you can rent a place, live in it, buy it from the landlord and sell a year later, and still qualify if the totals add up.

On a joint return, the joint limit applies if either spouse meets the ownership test, both spouses meet the use test, and neither spouse used the exclusion on another sale in the prior 2 years. 3 If those conditions are not all met, each spouse's limit is figured separately, as if they were unmarried. 3

How often you can use it

You generally cannot use the exclusion if you excluded gain on another home sold within the 2 years before this sale. 1 Publication 523 says it plainly: "You may take the exclusion only once during a 2-year period."

Publication 523 also lists situations that knock the exclusion out entirely, such as a home acquired through a like-kind exchange within the past 5 years. 1

When you move early: the partial exclusion

Life does not always wait for the second anniversary. If you fail the ownership test, the use test or the once-every-two-years rule, you may still get a reduced exclusion if the main reason for the sale was one of three things. 3

  • Work. For example, a new job at least 50 miles farther from the home than your old work location. 1
  • Health. A move for your own health or a family member's, as Publication 523 describes.
  • Unforeseeable events. Publication 523 lists examples including the home being destroyed or condemned, a casualty loss from a disaster, divorce or legal separation, death, multiple births from one pregnancy, and losing a job in a way that leaves you unable to pay basic living expenses. 1

The reduced limit is the full limit scaled down by the share of the 2-year period you did meet. 3 Publication 523 has the worksheet.

What the exclusion never covers

Depreciation after May 6, 1997. If you ever claimed depreciation on the home, for a home office or for renting part or all of it, you cannot exclude the part of the gain equal to that depreciation. 1 That piece is generally taxed, even when the rest of the gain is excluded. 3

Nonqualified use. Gain allocated to periods after 2008 when the home was not your main home, such as years it was a rental or a second home before you moved in, is generally not excluded. 3 The allocation uses the share of time the home was in nonqualified use. There are exceptions, including time after you move out, within the 5-year window, and Publication 523 walks through them. 3

Reporting the sale

You must report the sale on your return if you cannot exclude all of the gain, or if you received Form 1099-S, even when the whole gain is excludable. 2 Reported sales go on Form 8949 and Schedule D. 2

And if you sold at a loss: a loss on the sale of your main home is not deductible. 1

Worked example (hypothetical)

Hypothetical example, not law and not a client

Example, hypothetical round numbers, not a real person. Tax year 2026, main home, both tests met, no other home sale in the prior 2 years.

Dana bought her house for $320,000, including closing costs and later improvements. She lived in it for six years. She sells it for $790,000 and pays $30,000 in selling costs.

StepAmount
Sale price$790,000
Less selling costs$30,000
Amount realized$760,000
Less basis$320,000
Gain$440,000

If Dana files single, she can exclude up to $250,000. The remaining $190,000 of gain is reported on Form 8949 and Schedule D and taxed as a long-term capital gain.

If Dana is married filing jointly and her spouse also lived there for the required time, the limit is $500,000, which covers the whole $440,000. If she received a Form 1099-S, she still reports the sale and shows the exclusion.

Now add a home office. Suppose Dana had claimed $18,000 of depreciation on a home office after May 6, 1997. That $18,000 of the gain cannot be excluded, even in the joint case. The rest still can.

What to gather

  • The closing statement from your purchase and from your sale.
  • Records of improvements (not repairs) over the years.
  • The dates you owned and lived in the home, and any other home sale in the prior 2 years. 1
  • Any depreciation you claimed for a home office or rental use.
  • Form 1099-S, if you received one.

What this does not cover

  • The special rules for separated or divorced owners, surviving spouses, and military, Foreign Service and intelligence personnel on extended duty.
  • The full nonqualified-use calculation and its exceptions.
  • Like-kind exchanges, installment sales and inherited homes.
  • Selling vacant land next to your home, or a remainder interest.
  • How capital gain rates apply to the part that is not excluded.
  • State income tax.

Carry it forward

Count the gain, not the price, and check both tests on the calendar before you list the house.

If part of the home was ever rented out, the short-term rental rule explains how rental use is treated while you own it. For the other figures that change each year, see your 2026 return, by the numbers.

Questions

How much gain can I exclude when I sell my house?

Up to $250,000, or $500,000 on a joint return if both spouses meet the use test.

Does the time living in the house have to be continuous?

No. The time needs to add up over the 5 years before the sale; it does not have to be continuous. 1

Do I have to report the sale of my home if there is no tax?

Yes if you received Form 1099-S, or if any gain is not excluded. Otherwise, generally no.

I sold early because of a new job. Do I get anything?

Possibly a partial exclusion, if the move meets the work, health or unforeseeable-event rules.

Can I deduct a loss on selling my home?

No. A loss on your main home is not deductible.

Does depreciation from a home office affect the exclusion?

Yes. Gain equal to depreciation claimed after May 6, 1997 is not excluded.

Keep going

More on this path

Sources

  1. IRS Publication 523, Selling Your Home (external site) checked Oct 19, 2026
  2. IRS Topic no. 701, Sale of your home (external site) checked Oct 19, 2026
  3. 26 U.S.C. section 121 (exclusion of gain from sale of principal residence) checked Oct 19, 2026

Figures on this page

Checked

Every figure above comes from the source listed here, with the date we checked it and the date it is due for a re-check.

  • Home sale exclusion: maximum gain excluded federal-2026:home_sale_exclusion.max_gain_excluded
    26 U.S.C. sec. 121(b) checked 2026-09-24, review by 2027-01-22