No, you do not have to buy another house after selling your home to avoid federal taxes on the sale. The rule that once forced sellers to reinvest their proceeds in a new home was repealed in 1997. What matters now is how long you owned and lived in the property, not whether you buy again, when you buy again, or how much you spend if you do.
Under current federal law, a single filer can exclude up to $250,000 of profit from a home sale, and a married couple filing jointly can exclude up to $500,000, as long as they meet the ownership and use tests.1Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence You can rent your next place, move in with family, downsize, travel, or buy a mansion. None of it changes your tax bill on the sale you just closed.
What Changed in 1997
The old Section 1034 of the Internal Revenue Code required homeowners to roll their sale proceeds into a new home of equal or greater value within two years to defer capital gains tax. The Taxpayer Relief Act of 1997 repealed that rollover rule and put Section 121 in its place. Section 121 is not a deferral — it is an outright exclusion, and it is tied to the sale itself, not to any future purchase.1Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence
So the two-year clock some sellers still worry about does not exist for reinvestment. There is a two-year rule in the current law, but it works differently: you can only use the exclusion once every two years, and the ownership and use tests each require two years within a five-year window.
What You Actually Have to Do to Avoid Tax
To claim the full exclusion, you have to pass two tests during the five years ending on the date of sale:1Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence
- You owned the property for at least two of the last five years.
- You lived in it as your primary residence for at least two of those same five years.
The 24 months do not have to run consecutively. You could live there for 14 months, move out for a stretch, come back for another 10 months, and still qualify.2eCFR. 26 CFR 1.121-1 Exclusion of Gain From Sale or Exchange of a Principal Residence What matters is that the total residency inside the five-year lookback adds up to two years.
You also cannot have used the exclusion on another home sale within the two years before this one.3Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence That is the anti-flipping guardrail, and it is the only “two-year” timing rule that limits back-to-back sales.
How the Exclusion Amount Works
The dollar caps apply to profit, not sale price. If you bought for $300,000, put $50,000 into capital improvements, and sold for $575,000, your gain is $225,000 — under the single-filer cap, so no federal tax is owed on the sale. A married couple filing jointly can shelter up to $500,000 if either spouse meets the ownership test, both meet the use test, and neither claimed the exclusion on a different sale in the previous two years.1Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence
A surviving spouse can still use the $500,000 cap if the sale happens within two years of the other spouse’s death, they have not remarried, and the standard ownership and use tests are met counting the deceased spouse’s time.4Internal Revenue Service. Publication 523, Selling Your Home
Military and Foreign Service Duty
Service members and Foreign Service officers on qualified official extended duty can elect to pause the five-year lookback for up to 10 years.5eCFR. 26 CFR 1.121-5 Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service Time spent on duty away from the home does not count against you. The election is made by simply excluding the gain on the tax return for the year of sale.
Calculating Your Gain
Your taxable gain is not just the sale price minus the purchase price. Start with the original purchase price and add capital improvements — projects that add value, extend useful life, or adapt the home to a new use. Adding a room, replacing the roof, installing central air, remodeling a kitchen, building a deck, or putting in a pool all qualify. Routine repairs generally do not, unless they were part of a larger renovation.4Internal Revenue Service. Publication 523, Selling Your Home
From the sale side, subtract selling costs like real estate commissions, title fees, and transfer taxes from the sale price to get your net proceeds. Net proceeds minus adjusted basis is your gain. If the result is under $250,000 (or $500,000 for joint filers) and you meet the eligibility tests, you owe no federal capital gains tax.
When You Would Still Owe Some Tax
Buying a new home does not offset any of the taxes below. Since the rollover rule is gone, the price of your next house has no bearing on the tax due from the last one.
Gain Above the Cap
Profit above $250,000 or $500,000 is taxed at long-term capital gains rates of 0%, 15%, or 20%, depending on your taxable income.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Net Investment Income Tax
An additional 3.8% surtax can apply to the non-excluded portion of the gain when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).7Office of the Law Revision Counsel. 26 USC 1411 Imposition of Tax These thresholds are not adjusted for inflation.
Depreciation Recapture
If you ever claimed depreciation on the home, such as during years you rented it out or used part of it for a home office, that depreciation is taxed separately at a rate up to 25%, and the Section 121 exclusion does not shelter it.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Non-Qualified Use
If you used the home for something other than your primary residence at some point during ownership, a share of the gain tied to that period may be carved out of the exclusion. The non-excludable share is the time of non-qualified use divided by total ownership time.3Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence A rental period that happens after your last day living in the home does not count against you.
Property Originally Acquired in a 1031 Exchange
If you converted a former investment property into your home and originally acquired it in a like-kind exchange, you must own it for at least five years before the Section 121 exclusion is available.3Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence The two-year use test still applies on top of the five-year hold.
Selling Before Two Years
If you have to sell before hitting the two-year marks, you may still qualify for a partial exclusion when the sale is primarily due to a work move, a health issue, or another unforeseen circumstance.4Internal Revenue Service. Publication 523, Selling Your Home Common qualifying reasons include:
- A new job or transfer at least 50 miles farther from the home than the prior workplace.
- A move to obtain or provide medical care, or one recommended by a doctor for health reasons.
- A change in employment status that made basic living expenses unaffordable.
To size the partial exclusion, take the shortest of your ownership period, your use period, or the time since your last claimed exclusion, and divide by 24 months (or 730 days). Multiply that fraction by $250,000 or $500,000.4Internal Revenue Service. Publication 523, Selling Your Home Someone forced to sell after 18 months for a qualifying job move could exclude 18 ÷ 24 × $250,000, or $187,500.
Reporting the Sale
When the entire gain falls within the exclusion and you give the closing agent the required certification, no Form 1099-S is generally issued, and you usually do not need to report the sale on your return.8Internal Revenue Service. Instructions for Form 1099-S Proceeds From Real Estate Transactions If you do receive a 1099-S, report the sale even if all of the gain is excludable. Taxable gain above the cap is reported on Schedule D and Form 8949.9Internal Revenue Service. Topic No. 701, Sale of Your Home Hang onto your purchase records, improvement receipts, and closing statements for at least three years after filing.
Investment Property Is a Different Rule
If the property you sold was a rental or business property rather than your home, the 45-day and 180-day deadlines you may have heard about do apply — but under Section 1031, not Section 121. You must identify replacement property in writing within 45 days of closing and complete the purchase within 180 days (or by your tax return due date, whichever is earlier).10Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031 The proceeds must be held by a qualified intermediary the entire time; taking possession of the funds voids the deferral.11Office of the Law Revision Counsel. 26 USC 1031 Exchange of Real Property Held for Productive Use or Investment Personal residences do not qualify for 1031 exchanges. So if you have been told you need to reinvest within six months to avoid tax, that advice belongs to investment property, not the home you lived in.
Don’t Forget State Taxes
Everything above is federal. Most states also tax capital gains through their income tax, so a home sale that costs you nothing federally can still generate a state bill. A handful of states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — do not impose a traditional state income tax on capital gains. Everywhere else, check whether your state conforms to Section 121 or offers its own home sale rules, because the treatment varies.