Selling Your Home in Retirement: Capital Gains and Tax Implications

Selling a home in retirement is often a quietly profitable move — freeing up equity, reducing maintenance costs, and lowering property taxes and insurance. But how much of the sale proceeds you actually keep depends heavily on tax rules that haven’t been updated in decades. The Section 121 home sale exclusion lets most retirees walk away from a home sale with no federal capital gains tax. The exclusion has limits, though, and homeowners with appreciated long-held homes — especially in coastal markets — can face a significant tax bill if they don’t plan around them.

Infographic: home sale exclusion

How home sale capital gains work

When you sell your home for more than you paid for it (adjusted for certain costs and improvements), the difference is a capital gain. Like other capital gains, it’s taxable — but the IRS gives primary residences a special exclusion that most other investments don’t get.

The exclusion (under Section 121 of the tax code):

  • $250,000 of gain excluded if you file as single
  • $500,000 of gain excluded if you’re married filing jointly

These limits haven’t been adjusted since 1997. For homes purchased decades ago in markets that have seen significant appreciation, the limit is no longer enough to fully shelter the gain.

Who qualifies for the exclusion

To use the full Section 121 exclusion, you must meet two tests:

Ownership test

You must have owned the home for at least 2 of the last 5 years before the sale. The 2 years don’t need to be consecutive.

Use test

You must have used the home as your primary residence for at least 2 of the last 5 years. Again, not necessarily consecutive.

Look-back test

You can’t have used the exclusion on another home sale in the prior 2 years.

For most retirees who’ve lived in their home for many years, all three tests are easily met. The cases where they aren’t: vacation homes, investment properties, homes converted from rentals, or homes recently inherited.

Calculating your taxable gain

The gain is not just the sale price minus the purchase price. The accurate calculation:

  1. Sale price minus selling costs (real estate commissions, transfer taxes, attorney fees, etc.) = amount realized
  2. Original purchase price plus buying costs (closing costs, title insurance, etc.) = basis
  3. Basis plus capital improvements (anything that adds value or extends useful life — new roof, addition, kitchen remodel, finished basement, central air, etc.) = adjusted basis
  4. Amount realized minus adjusted basis = taxable gain

This is why keeping records of capital improvements over the decades matters. A retired couple who bought a home for $80,000 in 1985, sold it for $700,000 in retirement, but spent $120,000 on a kitchen, addition, and new roof over the years has an adjusted basis of $200,000 — not $80,000. Their gain is $500,000, not $620,000. With the $500,000 married exclusion, they pay zero federal capital gains tax. Without those improvement records, $120,000 of the gain becomes taxable.

When the gain exceeds the exclusion

If your gain is larger than $250,000 (single) or $500,000 (married joint), the excess is taxed at long-term capital gains rates — 0%, 15%, or 20% depending on your taxable income. For most retirees, the rate falls in the 0%–15% range.

Example: married couple sells a long-held coastal home with an $800,000 gain. The first $500,000 is excluded. The remaining $300,000 is taxed at long-term capital gains rates. If their taxable income for the year (including the gain) puts them in the 15% bracket, they owe $45,000 in federal capital gains tax. State capital gains tax may also apply — rates vary widely by state.

Net Investment Income Tax (NIIT) of 3.8% may apply on top, for high-income filers (modified adjusted gross income above $200,000 single / $250,000 married joint).

Strategies to reduce the tax bill

Find every capital improvement

Receipts, contractor invoices, even bank statements showing payments to home improvement vendors all add to your basis. Before selling, do a careful walk-through of the home and your records: any roof replacement, window replacement, addition, deck, finished basement, kitchen or bath remodel, central air installation, water heater replacement, fence, driveway paving — all add to basis. Routine maintenance (paint, repairs, lawn care) does not.

Time the sale across tax years

If you have flexibility on closing date, consider how the gain interacts with your other income. Selling in a year when your other income is low — such as the year after retirement, before Social Security starts, or before required minimum distributions begin — can keep more of the gain in the 0% capital gains bracket.

Don’t sell in a high-income year if avoidable

If you take a large IRA withdrawal, sell appreciated stocks, or have a Roth conversion in the same tax year as the home sale, you can stack income in ways that push you into higher brackets. Coordinate with your tax preparer or CFP.

Use loss harvesting

If you have unrealized losses in your taxable brokerage account, selling those positions in the same year as the home sale can offset some of the gain — tax-loss harvesting works against capital gains in either direction.

Infographic: home sale worked example

Charitable giving

If you’re charitably inclined, donating appreciated stock or making a Qualified Charitable Distribution (QCD) from your IRA in the same year can offset taxable income and potentially keep you in lower brackets.

Special situations

Surviving spouse rule

If you’re widowed and sell within 2 years of your spouse’s death, you can still use the full $500,000 married exclusion — even if you file as single. After 2 years, you’re limited to the $250,000 single exclusion. For long-held appreciated homes, this often makes selling within that 2-year window financially significant.

Stepped-up basis at death

If a spouse dies, the deceased spouse’s share of the home gets a “step up” in basis to the fair market value at date of death. In community property states, the entire home may step up. This often eliminates most or all of the capital gain — meaning that for some widowed homeowners, selling soon after a spouse’s passing is largely tax-free regardless of how much the home appreciated.

If the home is held until the homeowner’s own death, heirs receive a stepped-up basis at death and can sell with little or no capital gains tax. This is one reason some homeowners choose to keep an appreciated home until death rather than sell during their lifetime — though that decision involves trade-offs around maintenance, accessibility, and estate planning.

Partial exclusion for unforeseen circumstances

If you sell before meeting the 2-year ownership/use requirement due to a job change (50+ miles), health reasons, or other “unforeseen circumstances” (death of a spouse, divorce, multiple births, certain natural disasters), you may qualify for a partial exclusion based on how long you did meet the tests.

Home converted from a rental

If you previously rented the home and later moved in (or vice versa), the exclusion is reduced by the period of “non-qualified use” — time the home wasn’t your primary residence. Depreciation taken during rental periods must also be recaptured at a 25% rate. These rules are complex and almost always require professional tax preparation.

Vacation homes and second homes

Section 121 only applies to primary residences. Sale of a vacation home is fully taxable as a long-term capital gain. Some homeowners convert a vacation home into a primary residence for at least 2 of the 5 years before sale to qualify for partial exclusion — rules around this are restrictive but worth exploring with a tax professional if relevant.

State capital gains tax

Most states tax capital gains as ordinary income. A handful (Florida, Texas, Tennessee, New Hampshire on most income, Wyoming, Alaska, Nevada, South Dakota, Washington) have no state income tax and no state capital gains tax on home sales. A few states (notably Washington for high earners) have specific capital gains taxes that apply to certain sales. Check your state’s rules before assuming the federal exclusion is the whole picture.

Common mistakes

  • Throwing away improvement records. Receipts from a kitchen remodel 15 years ago can save $15,000 in taxes today. Keep them indefinitely if you still own the home.
  • Assuming all home improvement spending counts. Repairs and maintenance don’t add to basis. Only true capital improvements do.
  • Forgetting selling costs. Real estate commission alone (typically 5–6% of sale price) is a major reduction in your taxable gain — but you have to subtract it.
  • Missing the 2-year widow window. Surviving spouses planning to sell should know about the $500,000 married exclusion that applies for 2 years after a spouse’s death.
  • Not coordinating with retirement income. Stacking a home sale gain on top of a Roth conversion, large IRA withdrawal, or capital gains harvest in the same year can push more of the gain into higher brackets.
  • Forgetting state taxes. The federal exclusion gets the most attention but state capital gains can still apply.
  • DIY-ing a complex sale. If you have a non-standard situation (rental conversion, partial business use, unusual basis adjustments), use a CPA. The cost is small relative to the tax stakes.

What to do before selling

  1. Pull together every record of capital improvements over the years — receipts, invoices, contractor records, permits
  2. Estimate your gain: (sale price – selling costs) – (purchase price + buying costs + improvements)
  3. Compare against the $250K/$500K exclusion to see if any tax will be due
  4. If gain exceeds exclusion, consult a tax professional about timing the sale and coordinating with other income sources
  5. Confirm whether your state taxes capital gains and at what rate
  6. If widowed, check whether the 2-year window for the married exclusion still applies
  7. Decide whether to take a stepped-up basis (sell after death) approach if estate planning supports it

Bottom line

For most retirees, selling a long-held primary residence is largely or entirely tax-free thanks to the Section 121 exclusion. The traps come for homeowners with appreciated homes (especially in high-cost markets) who exceed the exclusion, sell vacation properties, sell within 2 years of a spouse’s death without realizing the $500K window applies, or fail to document capital improvements.

A short conversation with a tax preparer before the sale — not after — usually pays for itself many times over. The tax cost of getting this wrong on a single sale can equal years of careful saving.

Further Reading

This article is for general educational purposes only and does not constitute tax or financial advice. Tax rules change. Consult a qualified tax professional for guidance specific to your situation.

Leave a Comment