Selling Your Home in Retirement: The Tax Rules to Know
Most retirees owe no federal tax when they sell their home, because you can exclude up to $250,000 of gain ($500,000 if married filing jointly). Counting your selling costs and improvements, and timing other income around the sale, can often take the rest of the tax to zero.
Will you owe tax when you sell your home in retirement? For most retirees, the federal answer is no. You can exclude up to $250,000 of gain from the sale of your main home, or up to $500,000 if you're married filing jointly. But "most" isn't "all," and two things decide which side of that line you land on: calculating your gain correctly, and timing your other income around the sale.
This post is based on my video, Selling Your Home in Retirement: The Tax Rules to Know.
How much home sale gain can you exclude?
The exclusion applies to your gain, not your selling price. To get the full amount, you generally need to have owned the home and lived in it as your main home for at least two of the five years before the sale.
If you're married and claiming the $500,000 exclusion:
- Only one spouse needs to meet the ownership test.
- Both spouses need to meet the two-year residence test on their own. If one of you moved in recently, check this before you list.
- Neither of you can have claimed the exclusion on another home sale in the two years before this one.
Step 1: Calculate your real gain
Here's a couple who bought their home in 1996 for $225,000 and are selling it in 2026 for $900,000.
The quick math most people do:
- $900,000 sale price minus $225,000 purchase price = $675,000 gain
- $675,000 minus the $500,000 exclusion = $175,000 taxable
- $175,000 at a 15% capital gains rate = $26,250 in federal tax
The correct math:
- They paid $54,000 in commissions and other qualifying selling costs, so the amount they actually realized is $846,000.
- Over the years they spent $125,000 on a new roof, a new HVAC system, a kitchen remodel and a finished basement. Those improvements raise their basis from $225,000 to $350,000.
- $846,000 minus $350,000 = $496,000 gain, which is under the $500,000 exclusion.
- Federal capital gains tax: $0
That isn't a loophole. It's just counting costs they already paid.
Improvements vs. repairs
Improvements add to your basis. Routine upkeep doesn't. The IRS describes improvements as work that adds value to your home, prolongs its life, or adapts it to new uses. A new roof, a kitchen remodel, an addition or a finished basement count. Fixing a leak, painting, or replacing a broken lock or hinge generally doesn't, no matter how many of them you add up.
What if you didn't keep the receipts?
You can often rebuild the record from:
- Building permits
- Contractor records (whoever replaced your roof almost certainly has a file)
- Bank and credit card statements
Do this before you list the home, while you still have time to gather records and estimate your tax.
One more distinction: your taxable gain is not the same as the check you get at closing. Paying off a mortgage reduces your cash at closing, but it doesn't reduce your gain.
Step 2: Time your other income around the sale
Even a correctly calculated gain can produce an avoidable tax bill, because the rate on that gain depends on your other income that year.
Take a married couple with $150,000 of gain above the exclusion. They also plan to withdraw $200,000 from an IRA to help fund the move.
Scenario A: IRA withdrawal in the same year as the sale
- Other taxable income for the year: $260,000, which leaves no room in the 0% capital gains bracket
- $150,000 of gain at 15%: $22,500
- 3.8% net investment income tax on the gain: $5,700
- Federal tax on the gain: $28,200
Scenario B: IRA withdrawal moved to January, or funded from another account
- Other taxable income for the year: $60,000
- Under the 2026 married filing jointly brackets, the 0% rate applies up to $98,900 of taxable income, which leaves $38,900 of room. That much of the gain is taxed at 0%.
- The remaining $111,100 is taxed at 15%: $16,665
- In this version their adjusted gross income stays under $250,000, so the net investment income tax doesn't apply.
- Federal tax on the gain: $16,665
Same house, same price, same gain. Moving one withdrawal into a different tax year cut the tax by $11,535.
You won't always control when the sale closes or when certain income lands. But if you already know you'll be over the exclusion, a little planning around the gain can be worth a lot.
When the gain is too big to exclude
Not everyone gets under the exclusion. If you've owned a home for decades in a market where prices climbed, your taxable gain can be substantial, and the tax isn't always 15%.
- Capital gains rates: long-term gains are taxed at 0%, 15% or 20% depending on your taxable income. For 2026, the 20% rate starts above $545,500 of taxable income for single filers and $613,700 for married couples filing jointly.
- Net investment income tax: an extra 3.8% can apply when modified adjusted gross income is over $200,000 for single filers or $250,000 for married couples filing jointly.
Consider a single retiree who bought her home in 1985 for $150,000, put $100,000 of improvements into it, and sells it for $1.4 million with $84,000 in selling costs:
- Gain: $1,066,000
- After her $250,000 exclusion: $816,000 taxable
- With $70,000 of other taxable income, her federal tax attributable to the sale is about $166,000, before any state tax
Most retirees won't owe anything close to that. The point is that not every sale is tax-free.
The gain can raise other costs, too
The taxable part of the gain (not the excluded part) also counts as income for other purposes:
- Medicare premiums. Higher-income surcharges on Part B and Part D (IRMAA) are generally based on your tax return from two years earlier. A big taxable gain in 2026 can raise your premiums in 2028.
- Marketplace health insurance. If you're under 65 and on a marketplace plan, a large gain can reduce or eliminate your premium tax credit.
Model the full picture before you sell, not just the capital gains tax.
Special situations that change the math
1. The home was once a rental or second home. The order matters. If it was a rental or second home first and you moved in later, time after 2008 when it wasn't your main home can make part of the gain ineligible for the exclusion. If you lived there first and rented it out after moving out, that later rental period generally doesn't reduce your exclusion, as long as you still meet the two-out-of-five-year test. Either way, depreciation you claimed (or were entitled to claim) after May 6, 1997 can't be excluded and can be taxed at up to 25%. A home office deduction can create the same issue.
2. You're selling before you've lived there two years. A move for a new job at least 50 miles farther away, a health reason, or certain unforeseeable events can qualify you for a partial exclusion. Don't assume it's zero just because you fell short of two years.
3. You've lost a spouse. A surviving spouse may still qualify for the full $500,000 exclusion if the home is sold within two years of the death, you haven't remarried, and the other requirements are met. The deceased spouse's share of the home also generally gets a new basis equal to its value at the date of death, and in community property states both halves can. Review this before deciding when to sell.
4. You're moving to another state. Moving first doesn't make state tax disappear. The state where the home is located may still tax the gain, and your new state has its own residency and credit rules. The order of the move and the sale can matter.
What to do with the proceeds
If most of your savings are in traditional IRAs or 401(k)s, the sale proceeds give you money to spend without another taxable withdrawal. That can open room in future years for Roth conversions or deliberate withdrawals at lower tax rates.
The proceeds aren't a free pass on future taxes, though. Interest, dividends and gains earned after the sale are still taxable and can still affect your Medicare premiums.
Before closing, give the money three jobs:
- Your next home, whether that's a down payment or furnishing it
- A spending reserve
- A long-term investment strategy for the rest
Your checklist before you list
- Do you qualify for the exclusion? If you're married, do both of you meet the two-year residence test?
- Have you estimated your real gain, including selling costs and capital improvements?
- Does the home have any rental, home office or other unusual history?
- What else is on your tax return that year? IRA withdrawals, Roth conversions, even a closing date right at year end can change the answer.
- If you're moving across state lines, have you checked how both states treat the sale?
For many retirees, the federal tax on selling their home will be zero. For others, a little planning before the sale can save thousands of dollars, or at least prevent an unpleasant surprise. If your sale will create a tax bill, set the money aside now and ask whether you need to make an estimated tax payment. Don't assume the closing process will take care of it.
These examples use simplified assumptions and 2026 federal figures. Your numbers will be different, so run them with your tax preparer or advisor before you list.
If you're planning a move in retirement and want to see how it fits your broader plan, start here to schedule a conversation.
Sources
- IRS Publication 523, Selling Your Home
- IRS Topic No. 701, Sale of Your Home
- IRS Topic No. 559, Net Investment Income Tax
- IRS Revenue Procedure 2025-32 (2026 inflation adjustments, including capital gains brackets)
- SSA, Modified Adjusted Gross Income for Medicare premium adjustments (POMS HI 01101.010)
Have questions about your retirement plan?
Schedule a free, no-pressure introductory call with Erik.
Schedule a Call