Capital Gains Tax on a Home Sale When You Buy Another House
8 min read

Capital gains tax on a home sale does not depend on whether you buy another house, because current federal tax law does not tie capital gains treatment to reinvestment at all. No 60-day window, no six-month deadline, no "buy again or pay up" rule exists under the law as written today. That idea used to be true, decades ago, and it has stuck around in conversations at closing tables and family dinners long after the law that created it disappeared. We'll walk through why the myth exists, what actually determines your tax bill today, and the situations, like investment property, where real deadlines still apply.
Do you have to buy another house within a certain time to avoid capital gains tax?
No, current federal tax law doesn't require you to reinvest home sale proceeds into a new property within any timeframe to avoid capital gains tax. You can sell your house, put the money into stocks, pay off debt, rent for the next three years, or take a very long vacation, and none of it changes your tax exposure on the sale itself.
This myth has a real origin story, though, which is probably why it refuses to die. Before 1997, Section 1034 of the Internal Revenue Code let homeowners defer gains by rolling proceeds into a new primary residence of equal or greater value within two years. That rule created a genuine incentive to "buy up" quickly after a sale, and an entire generation of homeowners, agents, and even some tax preparers absorbed that lesson as gospel.
Then the Taxpayer Relief Act of 1997 repealed Section 1034 entirely and replaced it with something structurally different: the Section 121 exclusion, which has nothing to do with what you do after the sale and everything to do with how you owned and used the home before it. If you're getting advice that mentions a reinvestment deadline, you're getting advice built for a tax code that hasn't existed in over 25 years.
What is the Section 121 exclusion that actually determines your tax bill?
Section 121 of the Internal Revenue Code is what determines your tax bill today. It lets you exclude a large share of the capital gains on the sale of a primary residence from taxable income, with no reinvestment required. The exclusion amounts are:
- Single filers: up to $250,000 in excluded gain
- Married filing jointly: up to $500,000 in excluded gain
To qualify, you need to pass two tests, both measured over the five years leading up to the sale:
- Ownership test: You owned the home for at least two of those five years.
- Use test: You used the home as your primary residence for at least two of those five years.
Here's the detail that trips people up: those two-year periods don't have to be consecutive, and they don't have to overlap perfectly with each other. Say you owned a home for four years, lived in it for the first two, rented it out for a year, moved back in for eight months, then sold. As long as you can add up 24 months of ownership and 24 months of personal use somewhere in that five-year window, you clear both tests. This flexibility can help people who relocated for work, dealt with a life disruption, or had a tenant living in the home for a stretch before they moved back in.
Miss either test and you may still qualify for a partial exclusion if the sale was triggered by specific circumstances the Internal Revenue Service (IRS) recognizes, like a job change, health issue, or another unforeseeable event. It's prorated based on how much of the two-year requirement you actually met, not an all-or-nothing forfeiture. If you are weighing a sale before the two-year mark, read how long you should live in a house before selling.
Why did people used to believe buying a new home avoided the tax?
People used to believe buying a new home avoided the tax because, for decades, a real rule made that true. Section 1034's rollover provision was straightforward on its face: sell your home, buy another one of equal or greater value within two years, and you'd defer the gain rather than pay tax on it right away. Deferral, not elimination, but for most sellers moving up the housing ladder, it functioned as ongoing tax-free growth as long as they kept trading into pricier homes.
That system shaped how an entire generation talked about homeownership. Real estate agents advised clients to "roll" their proceeds forward. For decades, financial guidance treated the two-year reinvestment window as a basic planning fact, not a niche technicality. It became conventional wisdom the same way plenty of outdated financial advice does: repeated often enough, by people who believed it was still current, that it outlived the law behind it.
The Taxpayer Relief Act of 1997 replaced that entire framework with the exclusion system described above, and the shift was significant. Instead of tying your tax treatment to what you buy next, the law now ties it to how you used the home you're selling. That's a fundamentally different test, but the old rollover language never fully left the cultural conversation. You'll still hear it from well-meaning relatives, outdated blog posts, or advice columns that haven't been updated since before some sellers today were born.
How do you calculate whether your home sale profit is taxable at all?
You calculate whether your home sale profit is taxable by subtracting your adjusted basis from the sale price to find your capital gain, then checking that gain against the Section 121 exclusion limits. This is simpler than most people expect, and often the answer is that no tax is owed at all.
The formula:
Sale price - adjusted basis = capital gain
Your adjusted basis isn't just what you paid for the house. It's your original purchase price plus the cost of qualifying capital improvements you made over the years, things like a new roof, an addition, a kitchen remodel, not routine repairs or maintenance.
Here's how it plays out for a single filer:
| Item | Amount |
|---|---|
| Original purchase price | $300,000 |
| Capital improvements | $50,000 |
| Adjusted basis | $350,000 |
| Sale price | $600,000 |
| Capital gain | $250,000 |
For a single filer, that entire $250,000 gain falls within the Section 121 exclusion. No tax owed on the sale, assuming the ownership and use tests are met. A married couple filing jointly would have twice the buffer, meaning a gain like this wouldn't even come close to triggering tax.
This is exactly why tracking your basis matters, and it's worth doing before you list, not after. Homeowners routinely underestimate how much they've put into a property over the years, which can mean overestimating their taxable gain and worrying unnecessarily. Before you can run this math with any confidence, though, you need a realistic sale price to plug in, and a data-driven valuation like the free report from Kelley Blue Book Homes can show you where your home is actually likely to land rather than a rough guess.
What situations still involve strict deadlines after selling property?
Investment and rental property sales still involve strict reinvestment deadlines, and missing them carries real, unforgiving financial consequences.
If the home you sold wasn't your primary residence, Section 121 doesn't apply to it at all. Instead, investors looking to defer gains on business or investment property use a Section 1031 like-kind exchange, and this is where the deadlines from the old rollover era essentially still exist, just in a different part of the tax code:
- 45-day identification period: You must identify potential replacement properties in writing within 45 days of closing the sale.
- 180-day exchange period: You must close on the replacement property within 180 days of the original sale.
Miss either window and the exchange falls apart, meaning the full capital gain becomes taxable immediately, no partial credit. Working with a qualified intermediary and identifying replacement properties as early as possible can help reduce the risk of missing these windows.
A few other deadlines and limits worth knowing:
- Depreciation recapture: If you rented out the property at any point and claimed depreciation, that depreciation gets "recaptured" and taxed separately, even if the sale otherwise qualifies for the Section 121 exclusion on the personal-use portion.
- The two-year rule on claiming the exclusion: You can only use the Section 121 exclusion once every two years. If you sold a primary residence and excluded gain within the past two years, a second sale in that window likely won't qualify for another full exclusion.
The line between a primary residence sale and an investment property sale is where most of the real deadline pressure lives. If your situation blends the two, for example a former primary home you converted to a rental before selling, the rules interact in ways that are easy to get wrong. Consulting a tax professional before you sell is a reasonable safeguard in these blended situations.
Do state taxes follow the same rules as the federal home sale exclusion?
No, state and federal treatment of a home sale gain are not always the same, because state conformity to the Section 121 exclusion varies.
Some states fully conform to the federal exclusion amounts, meaning a gain excluded federally is excluded at the state level too. Others don't. California, for instance, doesn't conform to the federal exclusion structure the same way, and depending on your circumstances, a portion of your gain may still be subject to state tax even when the IRS gives you a pass. California taxes any gain that is left after the exclusion as ordinary income, while Nevada has no state income tax on a home sale at all.
This matters because sellers often assume that once they've confirmed they're under the federal exclusion threshold, they're in the clear entirely. State treatment is a separate question with its own rules, thresholds, and quirks, and it varies enough from state to state that a blanket assumption isn't safe.
The practical move here is straightforward: check your specific state's conformity rules before you sell, or better yet, consult a tax professional who handles real estate transactions regularly. It's a relatively small step compared to the size of a home sale, and it closes the gap between assuming you're covered and actually knowing where you stand.
How much capital gains tax do you pay on a home sale?
How much is capital gains tax on real estate you lived in?
For a primary residence, only gain above the $250,000 single or $500,000 joint exclusion is taxed. The rate on that remaining gain depends on your income and on how long you owned the home, so two sellers with the same profit can owe different amounts.
Does your age change the tax when you sell?
No. The old one-time break for sellers over 55 ended with the 1997 law, and Section 121 applies at any age. The two-year ownership and use tests and the size of your gain are what count.
How Kelley Blue Book Homes can help
Every calculation in this article, from your capital gain to whether you clear the Section 121 exclusion, starts with an honest number for what your home will actually sell for. Guessing high or low at that stage can throw off your whole tax picture before you even list.
Kelley Blue Book Homes brings the independent pricing authority Kelley Blue Book built over nearly a century to residential real estate. Its free home valuation report is engineered to land within 3% of the final sale price, built on neighborhood-level data that accounts for your specific renovations, micro-market trends, and seasonal timing rather than broad metro averages.
You can get a customized and independent home estimate quickly, and turn that initial estimate into a strategy with the support of a verified local expert from Kelley Blue Book Homes. Get your free home value report at KelleyBlueBookHomes.com.
Keep reading

How Long After Buying a House Can You Sell It
How long after buying a house can you sell it? Any time. Selling before two years loses the IRS gains exclusion, and most owners break even near year five.

How to Buy and Sell a House at the Same Time
How to buy and sell a house at the same time. Pick sell-first or buy-first by market, bridge the gap with equity or a bridge loan, and align both closings.
