Skip to content
GuideEvergreen guide

When your home sale profit is tax-free, and when it isn't

The federal exclusion can wipe out $250,000 or $500,000 of gain. It has traps, and a long-held house is where most of them live.

By Ray Okonkwo · Money & Business6 min read
When your home sale profit is tax-free, and when it isn't

Quick answer: If you owned the home and lived in it as your main home for at least two of the last five years, you can generally exclude up to $250,000 of profit from federal tax, or $500,000 if you're married and file jointly. Past that, or if the house was ever a rental, the rules get fussier. Check the current rules at IRS.gov (Publication 523) before you list.

The two tests

The law is Section 121 of the tax code, and it asks two plain questions.

Ownership: Did you own the home for at least two years out of the five before the sale?

Use: Did you live in it as your main home for at least two years out of those same five?

The two years don't have to be back to back. Twelve months, a year away for work, then twelve more months still counts. You also can't use the exclusion more than once every two years.

Married couples have a wrinkle. For the $500,000 limit, either spouse can meet the ownership test, but both must meet the use test, and neither can have claimed the exclusion on another home within the past two years. If only one of you qualifies, you're back to $250,000.

What "profit" means

Most people get this number wrong, and they get it wrong in the scary direction. Profit isn't sale price minus what you paid.

Your gain is the sale price, minus selling costs (agent commissions, closing fees), minus your adjusted basis. Adjusted basis is what you paid plus the money you put into improvements over the years.

Improvements count. A new roof, an addition, a finished basement, a kitchen remodel, a deck. Repairs don't. Patching the roof is maintenance. Replacing it is an improvement. Painting a room is maintenance. Gutting the bathroom isn't.

Here's a worked example. These numbers are made up to show the math, not real market figures.

  • Bought in 1994 for $140,000
  • Spent $60,000 over the years on a roof, a kitchen and a deck
  • Sells now for $620,000, with $40,000 in selling costs

Adjusted basis is $200,000. Gain is $620,000 minus $40,000 minus $200,000, which is $380,000.

A married couple filing jointly excludes the whole thing. Tax owed on the gain: zero. A single seller excludes $250,000 and has $130,000 of taxable gain.

That's why a shoebox of old receipts is worth real money. If you can't prove the $60,000, you've handed the IRS an argument. Pull the paperwork together now, not the week of closing.

The limits don't move

The $250,000 and $500,000 figures have been in the code since 1997. As far as I know they aren't indexed for inflation, so confirm the current numbers at IRS.gov. A house bought for $150,000 in the nineties that's now worth $800,000 can blow past the cap without anybody having done anything clever. Plenty of ordinary couples who've stayed put thirty years are in that position.

Gain over the limit is generally taxed as a long-term capital gain. The rates and income thresholds change, so look up the current ones. If your income is high enough in the sale year, an additional surtax on investment income can also apply.

When you sell before two years

Life interrupts. A job transfer, a health problem or another unforeseen event can qualify you for a partial exclusion. The rough idea is that you get the same fraction of the maximum as the fraction of two years you actually lived there. Illustrative example: a single owner who qualifies for a partial exclusion after twelve months might exclude about half of $250,000, or $125,000.

The IRS decides what counts as a qualifying reason, and "I changed my mind" generally isn't one. Get a CPA to look at your facts before you assume you qualify.

There's also a provision for owners who become unable to care for themselves and move into a licensed care facility. Time in the facility can count toward the use test under conditions the IRS spells out. If that's your situation, or a parent's, read the publication and ask a professional.

The traps

Renting it out. If the house was a rental before you moved in, or you moved out and rented it afterward, part of the gain tied to those years may not qualify. The calculation is a proration, and it's easy to botch.

Depreciation. If you claimed depreciation on a home office or a rental portion after May 1997, that piece is generally taxed when you sell, even if the rest of the gain is excluded. This catches self-employed men more than almost anyone.

A second home. The exclusion is for your main home. A lake cabin or Florida condo doesn't qualify unless it truly was your primary residence for the required time.

A loss. If you sell your personal residence for less than your basis, you can't deduct the loss. The exclusion is a one-way street.

State tax. Many states follow the federal exclusion. Some don't, or treat it differently. Look up your own.

The part that reaches Medicare

A taxable gain doesn't just cost you capital gains tax. It lifts your income for the year, and that can push you into a higher bracket, make more of your Social Security taxable, and raise your Medicare Part B and Part D premiums. The premium surcharge, called IRMAA, is based on income from two years earlier. So a one-time gain this year can show up on your Medicare bill later.

If you're near a threshold, timing matters. So does the order you pull money from your accounts in the sale year. Which Retirement Account To Spend From First walks through that sequence. Check the current Medicare brackets at Medicare.gov and SSA.gov.

Sell, or hold

If you're well under the limit, selling when it suits you costs nothing in federal tax, and that makes the move a pure logistics question. Before you pick a town, read What to Check Before You Retire to a Small Town. And if the sale proceeds are tempting you to wipe out the mortgage on the next house, When To Pay Off The Mortgage Before You Retire covers when that's smart and when it isn't.

If your gain is well over the limit, the math changes. Heirs generally receive property with a basis reset to its value at death, which can erase decades of gain. That's a real consideration, but a house you keep for tax reasons still has to be maintained, insured and lived in. Never let the tax tail wag the retirement dog. An estate attorney and a CPA can weigh it against your actual situation.

Before you list

  1. Find your purchase documents and your improvement receipts.
  2. Count your two-in-five years on a calendar, including any months it was rented.
  3. Estimate your gain using the formula above, and compare it to $250,000 or $500,000.
  4. Check IRS.gov for the current rules, and see what your state does.
  5. Sit down with a CPA, and a fee-only fiduciary adviser if the sale is large, before you sign a contract, not after.

This is general education, not individual tax, legal or financial advice. A house you worked thirty years to pay for deserves a half-hour with a professional who has read your actual numbers.

Ray Okonkwo

Money & Business

Former commercial banker turned small-business owner. Covers salary, credit, margins and the arithmetic nobody does before signing.

Watch

Worth an hour of your evening

More from Retirement.

From channels we rate. Plays on YouTube.

    AzulJun 3

    My Biggest Downsizing Mistakes In Retirement

    Retire Confidently.Aug 23

    Retirees, DON’T Downsize Without Knowing This!

    Rita WilkinsDec 13

    The Truth About Downsizing and Decluttering: What No One Tells You, but You Need to Know

    Jerry PinkasApr 11

    The Downsizing Trap Nobody Warns You About