Selling Your House and Buying a New One: Tax Rules You Should Know
The Myth That Refuses to Die
Before the Taxpayer Relief Act of 1997, there was a provision that let homeowners defer capital gains tax by rolling the proceeds into a new, more expensive home within two years. People over 55 got a one-time $125,000 exclusion. Both rules were scrapped almost three decades ago.
They were replaced by Section 121 of the Internal Revenue Code, which is actually more generous for most people. Under the current law, you can exclude up to $250,000 of gain ($500,000 if married filing jointly) when you sell your primary residence — and you don’t have to buy another home to get the exclusion. You could sell, pocket the cash, rent an apartment, move to another country, or buy a boat. The exclusion applies regardless of what you do with the proceeds.
We still get clients every week who think they need to buy a replacement home to avoid taxes. They don’t. The purchase of your next home is a completely separate transaction for tax purposes.
Section 121: The Rules That Actually Apply
To qualify for the capital gains exclusion on your home sale, you need to meet two tests (per IRS Publication 523):
- Ownership test: You owned the home for at least 2 of the 5 years before the sale
- Use test: You lived in the home as your primary residence for at least 2 of the 5 years before the sale
The two years don’t need to be consecutive, and the ownership and use periods don’t need to overlap perfectly. You could buy a home, rent it out for two years, move in for two years, and sell after four — you’d still qualify.
Married couples filing jointly can exclude up to $500,000 if both spouses meet the use test and at least one meets the ownership test. If only one spouse meets both tests, the exclusion drops to $250,000.
You can use this exclusion repeatedly — just not more than once every two years. There’s no lifetime cap, no age restriction, and no requirement to report the sale if the entire gain is excluded and you didn’t receive a Form 1099-S (though we recommend reporting it anyway).
Calculating the Gain on Your Home Sale
The gain isn’t just sale price minus purchase price. You need to account for selling costs and your adjusted basis. Here’s the formula:
Amount Realized = Sale Price minus selling expenses (broker commissions, transfer taxes, attorney fees)
Adjusted Basis = Original purchase price + acquisition costs + capital improvements – any depreciation claimed
Capital Gain = Amount Realized minus Adjusted Basis
For a detailed walkthrough with numbers, see our capital gains tax calculator guide. The short version: track every capital improvement you make to your home. That $35,000 bathroom renovation, the $12,000 new roof, the $8,000 deck — all of it increases your basis and reduces your taxable gain.
What Happens When You Sell at a Loss
Bad news here. If your home sells for less than you paid (adjusted basis), you can’t deduct the loss. The IRS doesn’t allow losses on the sale of personal-use property per IRC §165(c). It doesn’t matter how much you lost — $10,000 or $200,000 — a loss on your primary residence is not tax-deductible.
This asymmetry frustrates a lot of homeowners. Gains above the exclusion are taxable, but losses aren’t deductible. The tax code treats your home as a consumption asset, not an investment, for loss purposes.
There’s one exception worth knowing: if you converted your primary residence to a rental property before selling, and you sold it as a rental property at a loss, that loss may be deductible. The rules are specific — your basis for the loss calculation is the lower of your original basis or the fair market value on the date of conversion. Talk to a CPA before assuming a converted property loss is deductible, because the math isn’t intuitive.
Partial Exclusion When You Haven’t Met the 2-Year Requirement
Life doesn’t always cooperate with tax timelines. If you need to sell your home before living there for two full years, you might still qualify for a partial exclusion under one of these circumstances (per IRC §121(c)):
- Change in employment: Your new job is at least 50 miles farther from the home than your old job was
- Health reasons: A doctor recommends the move, or you’re moving to care for a family member
- Unforeseen circumstances: Divorce, death, natural disaster, multiple births (twins or more), job loss, inability to pay the mortgage
The partial exclusion is prorated. If you lived in the home for 15 months out of the required 24, you get 15/24 of the full exclusion. For a single filer, that’s $156,250 instead of $250,000. For a married couple, $312,500 instead of $500,000.
You don’t need IRS approval to claim the partial exclusion. Just meet one of the qualifying circumstances and calculate the prorated amount on your return.
Reporting the Sale Even When It’s Fully Excluded
If the closing agent issues a Form 1099-S (which reports the gross proceeds of the sale), you need to report the transaction on your tax return — even if your entire gain is excluded under Section 121. You’ll report it on Form 8949 and Schedule D, show the exclusion as an adjustment, and the net taxable gain will be zero.
Skipping the reporting when you received a 1099-S is a mistake. The IRS will see the 1099-S and, without a matching entry on your return, they’ll assume you failed to report taxable income. That triggers a CP2000 notice, and now you’re spending time responding to an audit that could have been avoided with a few extra lines on your return.
Mortgage Interest Deduction on Your New Home
When you buy your next home, the mortgage interest deduction is one of the tax benefits people think about most. The current rules (under the Tax Cuts and Jobs Act per IRC §163(h), which runs through 2025) allow you to deduct interest on up to $750,000 of mortgage debt used to buy, build, or substantially improve your primary residence or second home. For mortgages originated before December 15, 2017, the limit is $1,000,000.
The deduction only helps if you itemize. Since the standard deduction is $15,000 for single filers and $30,000 for married couples in 2025, many homeowners — especially those with smaller mortgages — don’t have enough itemized deductions to make itemizing worthwhile. A $300,000 mortgage at 7% generates about $21,000 in interest the first year. Add property taxes (capped at $10,000 SALT per IRC §164(b)(6)) and state income taxes, and a married couple might barely clear the $30,000 standard deduction threshold.
If TCJA sunsets after 2025, the mortgage interest limit reverts to $1,000,000 and the standard deduction drops. That would change the math for a lot of buyers. Worth watching.
Moving Expenses: No Longer Deductible for Most People
Before 2018, you could deduct moving expenses if your new job was at least 50 miles farther from your old home than your old job was. TCJA suspended this deduction per IRC §217(k) for everyone except active-duty military members. That suspension runs through 2025.
If you’re moving for a job and you’re not military, your moving costs are not deductible. Your employer can reimburse you, but the reimbursement is taxable income (again, except for military). This catches people off guard, especially those relocating for work who remember the old rule.
After 2025, the moving expense deduction might come back if TCJA sunsets. But for now, plan on absorbing those costs without a tax break.
Timing Considerations When Selling and Buying
While buying another home doesn’t affect your capital gains tax, timing still matters for other reasons.
Property Tax Proration
When you sell, property taxes are prorated between buyer and seller at closing. If you close mid-year, you’ll get credit for the portion of the year the buyer owns the home. This isn’t a tax deduction issue — it’s a cash flow issue at closing. But it affects how much property tax you can deduct on your return for that year.
Year-End Sales
Selling in December versus January of the following year can shift a large capital gain into a different tax year. If you had unusually high income this year, waiting until January might land the gain in a lower tax bracket next year. Or vice versa. This is basic tax planning, but people forget about it when they’re focused on the real estate transaction itself.
The 2-Year Clock
If you’re planning to sell your next home eventually, the 2-year clock for Section 121 starts when you move in. Buying a home and renting it out before moving in yourself delays the start of the use test. Living in it immediately starts the clock, giving you maximum flexibility on timing the eventual sale.
1031 Exchanges Don’t Apply to Your Personal Home
A 1031 exchange lets you defer capital gains tax by reinvesting sale proceeds into a like-kind property. But it only works for investment or business property per IRC §1031. Your personal residence doesn’t qualify.
There’s one scenario where Section 121 and 1031 can overlap: if you convert your primary residence to a rental property, rent it for a qualifying period, then sell it through a 1031 exchange. You might be able to exclude the gain attributable to the years you lived there (under Section 121) and defer the remaining gain (under 1031). This is advanced planning that requires precise timing and documentation. Don’t try it without a CPA walking you through the requirements.
What to Do Before You List Your Home
Get your records together before you talk to a real estate agent. You’ll want documentation for your original purchase (closing statement/HUD-1 or Closing Disclosure), every capital improvement you’ve made (receipts, contractor invoices, permits), and any depreciation you’ve claimed if you rented the property or took a home office deduction.
Run the gain calculation early. If your gain is well under the $250,000/$500,000 exclusion, you’re in the clear and there’s not much tax planning to do. If your gain exceeds the exclusion — common in New York, San Francisco, and other high-appreciation markets — talk to a tax advisor before closing. There may be strategies to reduce the taxable portion: timing the sale, maximizing your basis with documented improvements, or structuring the transaction differently.
The worst time to find out you owe $60,000 in capital gains tax is after you’ve already spent the proceeds on your next down payment.
Frequently Asked Questions
Do I have to buy a new home to avoid paying capital gains tax on the sale of my house?
How long do I have to live in my house to avoid capital gains tax?
Can I deduct the loss if I sell my house for less than I paid?
Do I have to pay capital gains tax on the sale if I use all the money for a down payment on a new house?
If I rent out my home for a few years before selling, do I still get the exclusion?
Sources & References
- IRC §121 — Exclusion of Gain from Sale of Principal Residence (Cornell Law)
- IRS Publication 523 — Selling Your Home
- IRC §1031 — Exchange of Real Property Held for Productive Use or Investment (Cornell Law)
- IRC §163(h) — Mortgage Interest Deduction (Cornell Law)
- IRC §165(c) — Limitation on Losses for Individuals (Cornell Law)
- Taxpayer Relief Act of 1997 (Congress.gov)
- IRS Form 8949 — Sales and Other Dispositions of Capital Assets
Work With The Reed Corporation
Need help with your taxes? Our NYC CPA team handles individual returns, business filings, and year-round advisory.