Skip to content

Capital Gains Tax on a Home Sale: You Have No Deadline to Buy Another House

There is no time limit to buy a new house after selling one, because the replacement rule was repealed in 1997. What matters is the $250,000 or $500,000 exclusion and whether you lived there two of the last five years.

Tech Talk News Editorial

9 min read

Share

Key takeaways

  • You have no deadline to buy another house after selling your home, because the rule that required reinvesting in a replacement home was repealed in 1997 and the home sale exclusion does not depend on buying anything.
  • You can exclude up to $250,000 of gain on the sale of your main home, or $500,000 on a joint return, if you owned and lived in it for at least 2 of the 5 years before the sale.
  • If you fail the 2-of-5-year tests because of a work move, a health problem or an unforeseeable event, you can claim a partial exclusion, such as $156,250 for 15 months of use ($250,000 times 15 over 24).
  • You can use the exclusion again, but generally not if you excluded gain on another home sold within the previous 2 years.
  • Section 1031 like-kind exchanges, which have their own deadlines, apply only to investment or business property, not to your main home.
On this page8 sections

How much time after selling a house do you have to buy another one to avoid the tax? None. There is no deadline, no penalty and no requirement to buy a replacement home.

You avoid the tax with the home sale exclusion. It covers up to $250,000 of gain, or $500,000 on a joint return, if you owned and lived in the house for 2 of the last 5 years.[1] [2]

The deadline you're half-remembering existed. It was repealed in 1997. I checked this against the IRS topic page, the statute and Publication 523 as of November 29, 2026.

0 days
Time limit to buy a replacement home
$250,000
Gain you can exclude, single
$500,000
Gain you can exclude, married filing jointly
2 of 5
Years you must have owned and lived in it

Where the rebuy rule came from

Before August 1997, the old section 1034 let you defer tax by rolling the gain into a replacement home. That deadline is the part everybody remembered. The only other break was a one-time exclusion for people aged 55 or older.[2]

The Taxpayer Relief Act of 1997 repealed section 1034 and rewrote section 121 into the exclusion we use now. It became law on August 5, 1997.[2]

The IRS's own basis worksheet in Publication 523 still has a line for gain postponed on a home sold before May 7, 1997. That's a fossil of the old rule, and a sign of how long the myth has had to circulate.[3]

Side note

The number 2 still shows up in this rule, which is probably why the myth won't die. It's now your 2 years of ownership, your 2 years of use, and a 2-year wait between exclusions. None of them is a deadline to buy.

The home sale exclusion in plain terms

Section 121 of the Internal Revenue Code excludes gain from the sale of your principal residence if you owned and used it as your main home for periods totaling 2 years or more during the 5 years ending on the sale date.[2]

The statute puts the limit at $250,000, rising to $500,000 on a joint return.[2] Those dollar amounts are written into the law, so there's no separate tax year 2026 figure.

The tests, step by step

  1. Ownership. You owned the home for at least 24 months out of the 5 years before the sale.[1]
  2. Use. You used it as your main home for at least 24 months in the same 5-year window. The two periods can differ.[1]
  3. Look-back. You generally didn't exclude gain on another home sold in the 2 years before this sale.[1] [2]
  4. Joint return. For the full $500,000, either spouse must meet the ownership test, both must meet the use test, and neither can be barred by the look-back rule.[2]

A worked example

Say you bought a house for $300,000, put in $30,000 of improvements and sold it for $750,000 with $45,000 of selling costs. Your gain is the sale price less selling costs less your adjusted basis, so $750,000 minus $45,000 minus $330,000 is $375,000 (my arithmetic, following the Publication 523 method).[3]

Taxable gain on a $375,000 home sale gain under three situations
SituationGainExcludedTaxable gain
Single, passes both tests$375,000$250,000$125,000
Married filing jointly, both pass the use test$375,000$375,000 (limit is $500,000)$0
Single, lived there 15 months, sold for a job move$375,000$156,250$218,750

The $125,000 left in row one is taxed as a capital gain, and a high earner may also owe the net investment income tax.[4] The third row uses the partial exclusion, explained next. Notice that buying a replacement home changes none of these numbers.

When you fall short: the partial exclusion

If you fail the ownership or use test, you may still get part of the exclusion when the main reason for selling was a work change, a health problem or an unforeseeable event.[3]

  • Work. You took a new job at least 50 miles farther from the home than your old work location.[3]
  • Health. A doctor recommended a change of residence because of a health problem.[3]
  • Unforeseeable events. The home was destroyed or condemned, or a death, a divorce or a job-related change left you unable to pay basic living expenses.[3]

To figure the amount, take the shortest of three periods: your use in the past 5 years, your ownership, or the time since your last exclusion. Divide it by 24 months (or 730 days) and multiply by $250,000. For a joint return, do the same for each spouse and add the results.[3]

Fifteen months gives $250,000 times 15 over 24, which is $156,250.

When part of your gain is still taxable

  • Depreciation. You can't exclude gain up to the depreciation you took, or could have taken, on a home office or rental after May 6, 1997.[2] [3]
  • Non-residence years. Gain tied to any period after 2008 when the property wasn't your main home, with some exceptions, may not be excludable.[3]
  • Gain over the cap. Everything above $250,000 (single) or $500,000 (joint) is taxable.[2]
  • A second sale too soon. You generally can't exclude gain if you excluded gain on another home sold within the previous 2 years.[1]

Do you have to report the sale?

Report it if you received Form 1099-S, even if all the gain is excludable. Report it too if you can't exclude all of the gain. The IRS says to use Form 8949 and Schedule D.[1] The 1099-S shows the date of sale in box 1 and the gross proceeds in box 2.[3]

Where 1031 exchanges fit, and where they don't

If your memory includes tight clocks and a replacement property, you may be thinking of a section 1031 exchange. That's a separate tool for investment or business property, with its own deadlines.

Publication 523 is blunt that you can't convert the replacement property to a main home immediately after the exchange. Section 1031 requires it to be held for investment or business.[3]

The rules for rental property that you moved into, or a home you turned into a rental, can stack both sections. For that, read my 1031 exchange explainer.

Takeaway

Don't buy a house to dodge a tax that has no rebuy rule. Check your 24 months of ownership and 24 months of use, compare your gain to $250,000 or $500,000, and only then decide whether a purchase makes sense on its own merits.

If you're deciding whether to buy again at all, that's a housing question, not a tax one. Start with renting vs buying a home.

For gain on assets other than your home, see how capital gains thresholds work. The exclusion is also one of the rules in what is tax-free income.

Primary sources

  1. 1.PrimaryIRS, Topic No. 701, "Sale of your home". $250,000 and $500,000 exclusion, 24-month ownership and use tests in the 5 years before sale, 2-year look-back, reporting with Form 1099-S, Form 8949 and Schedule D.
  2. 2.Primary26 U.S.C. § 121, exclusion of gain from sale of principal residence. Statutory limits and tests, reduced exclusion, depreciation after May 6, 1997, and the note that Pub. L. 105-34 (August 5, 1997) rewrote section 121 and repealed section 1034.
  3. 3.PrimaryIRS, Publication 523 (2025), Selling Your Home. Partial exclusion reasons and formula, 50-mile work test, nonqualified use after 2008, gain postponed before May 7, 1997, 1031 and main home interplay, Form 1099-S boxes.
  4. 4.PrimaryIRS, Topic No. 409, "Capital gains and losses". Net capital gain rates and the reference to the net investment income tax.

Frequently asked questions

6 questions

How long do you have to buy another house after selling to avoid capital gains tax?

You have no deadline, because there is no rule requiring you to buy another house. The old rule that let you roll your gain into a replacement home was repealed in 1997. Today you avoid tax on up to $250,000 of gain, or $500,000 on a joint return, by meeting the ownership and use tests.

Do I have to pay capital gains tax if I sell my house and do not buy another?

Only on gain above your exclusion. A single seller who owned and lived in the home for 2 of the last 5 years can exclude up to $250,000 of gain, and a married couple filing jointly can exclude up to $500,000. Any gain over that is taxed as capital gain.

What are the two-out-of-five-year rules for selling a home?

To exclude the gain, you must have owned the home for at least 24 months and used it as your main home for at least 24 months during the 5 years ending on the sale date. The two periods do not have to be the same 24 months, and you do not have to be in the house at the time of sale.

Can I get a partial exclusion if I lived there less than two years?

Yes, if the main reason for selling was a work change, a health problem or an unforeseeable event. The partial exclusion equals $250,000 times the shorter of the months you used the home or 24, divided by 24, and doubled for a joint return if both spouses qualify.

Does a 1031 exchange work on my primary residence?

No. A section 1031 exchange applies to property held for investment or for productive use in a business. The IRS says you cannot convert replacement property to a main home immediately after the exchange, so your own home uses the section 121 exclusion instead.

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

Yes, if you received a Form 1099-S, even when you can exclude all of the gain. You also report the sale if you cannot exclude all of the gain. The IRS says to use Form 8949 and Schedule D.

Keep reading

Written by

Tech Talk News Editorial

Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.

About Tech Talk News
Filed under#capital gains#home sale#taxes#real estate#personal finance
ShareXLinkedInRedditEmail