Capital Gains Tax on Selling a Home Explained Simply

Most home sellers owe $0 in capital gains tax—but the exceptions cost people thousands. Learn the 2-of-5-year rule, what counts as your cost basis, and why rentals bite hardest.

Capital Gains Tax on Selling a Home Explained Simply

You sell the house you've lived in for eleven years. The closing papers get signed, the wire lands in your account, and for about forty-eight hours you feel like you've won. Then a friend mentions the words capital gains tax on selling a home and your stomach drops. How much of that money is actually yours?

Here's the part nobody tells you at the closing table: for most people selling a primary residence, the answer is zero tax. But "most people" is doing a lot of heavy lifting in that sentence, and the exceptions are where real money gets lost.

I've watched this play out on both sides. I've helped friends untangle their numbers before a sale, and I've made my own expensive mistake years ago when I sold a rental property without understanding how depreciation recapture works. That one cost me more than a used car. So let's walk through this properly.

Key Takeaways

  • If you've lived in the home as your primary residence for 2 of the last 5 years, you can exclude up to $250,000 of profit as a single filer, or $500,000 if married filing jointly.
  • Only the gain is taxed, not the sale price. Gain = sale price minus your cost basis minus selling costs.
  • Your cost basis isn't just what you paid. Capital improvements add to it; routine repairs don't.
  • Rental properties and inherited homes follow different rules, and the rental rules are the ones that bite hardest.
  • A 3.8% surtax on investment income can apply to large gains if your income is high enough.

How capital gains tax on selling a home actually works

The tax isn't levied on what the house sold for. It's levied on your gain, which is a much smaller number and, in many cases, a negative one once you subtract everything you're allowed to subtract.

Start with the sale price. Subtract the costs of selling — agent commissions, title fees, escrow charges, transfer taxes, attorney fees. That gives you the net proceeds. Then subtract your adjusted cost basis: what you originally paid, plus qualifying capital improvements, minus any depreciation you claimed. Whatever's left is your taxable gain.

What can be deducted from capital gains when selling a house?

Selling costs come off the top: real estate commissions, title insurance, escrow and settlement fees, recording fees, transfer taxes, and legal fees directly tied to the sale. On the purchase side, you can add things like title insurance and certain settlement costs to your basis too.

Then come the capital improvements — and this is where most people leave money on the table. A new roof qualifies. A kitchen remodel qualifies. Adding a deck, replacing the HVAC system, installing new windows, rewiring the house? All qualify. They're permanent, they add value, and they last.

What doesn't qualify is the stuff that just keeps the house running. Painting a room. Fixing a leak. Replacing a broken dishwasher. Those are repairs, and the IRS treats them as maintenance, not investment. The line between the two is blurrier than you'd hope, and homeowners routinely lose the argument because they didn't keep receipts.

One habit I'd push on anyone: keep a folder. Every improvement, every receipt, every permit. I started doing this after that rental property mistake, and when I finally sold a different property, that folder shaved thousands off what I would have owed. Documentation is the difference between a deduction and a wish.

The primary residence exclusion: your biggest lever

This is the rule that makes most home sales tax-free, and it's more generous than people expect.

The primary residence exclusion: your biggest lever

If you've owned and lived in the home as your primary residence for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly). That's not a one-time thing either — you can use it again, generally once every two years.

The 2-out-of-5 rule is flexible in ways that surprise people. Those two years don't have to be consecutive. You could live there, rent it out for a while, move back — as long as the total occupancy hits the threshold within the five-year window, you're typically fine.

One-time capital gains exemption for home sale

Here's a correction worth making clearly: the primary residence exclusion is not a one-time exemption. You can claim it repeatedly, subject to the once-every-two-years limit. If you sell a home, buy another, live in it two years, and sell again, you can exclude the gain again.

Where the "one-time" language shows up is in partial exclusions for people who don't meet the full 2-of-5 test — job relocation, health reasons, divorce, multiple births from one pregnancy, or other unforeseen circumstances. In those cases, you can claim a reduced exclusion, and the amount is capped based on how long you actually lived there. The reason people call it "one-time" is that it's a limited escape hatch, not a recurring benefit. Once you've used it for a given sale, it doesn't regenerate.

One-time capital gains exemption for seniors

There is a widely repeated claim that seniors get a special one-time exemption on top of the standard exclusion. That is not how the current rules work. The primary residence exclusion applies to you regardless of age — a 78-year-old seller gets the same $250,000 or $500,000 exclusion as a 38-year-old.

What does exist is a narrower, older provision tied to sellers aged 55 and over that required a one-time election and was phased out decades ago. Anyone citing it as a live option today is working from outdated information. If you're a senior selling your home, the standard exclusion is your tool, and it's usually more generous than the historical rule ever was.

Walking through a real number

Say you bought a home for $280,000 ten years ago. Over that decade you replaced the roof ($18,000), remodeled the kitchen ($40,000), and put in new windows ($12,000). Your adjusted basis is $350,000.

Walking through a real number

You sell for $620,000. Selling costs — commission, title, escrow — run $46,000. Your net proceeds are $574,000. Subtract the basis: your gain is $224,000.

As a single filer who's lived there the whole time, the entire $224,000 falls under the $250,000 exclusion. Tax owed: nothing.

Now change one variable. You sell for $700,000 instead. Net proceeds: $654,000. Gain: $304,000. Subtract the $250,000 exclusion, and you owe tax on $54,000 — taxed at long-term capital gains rates, which historically sit below ordinary income rates. On that amount, in most brackets, you're looking at a bill in the range of $8,000 to $10,800, plus a possible 3.8% surtax if your income crosses the threshold.

That's the whole game. The gap between paying nothing and paying five figures usually comes down to basis documentation and a sale price that edges past the exclusion.

When the exclusion doesn't save you

SituationStandard exclusion applies?What to watch
Primary residence, 2+ yearsYesKeep improvement receipts
Rental propertyNoDepreciation recapture taxed as ordinary income
Inherited homeSpecial basis ruleStep-up basis resets value to date of death
Sold after 18 monthsPartial, if qualifying reasonReduced exclusion based on time lived
Second home / investmentNoFull gain taxable

Taxes on selling a house that was inherited

Inherited homes are, in one specific way, the most forgiving category. When you inherit a property, your basis generally gets stepped up to the fair market value on the date of the original owner's death. All the appreciation that happened during their lifetime essentially disappears from the tax picture.

When the exclusion doesn't save you

If your parent bought a house for $60,000 in 1985 and it's worth $700,000 when they pass, your starting basis is $700,000 — not $60,000. Sell it for $720,000 six months later, and your taxable gain is roughly $20,000, minus selling costs. That's it.

The trap is holding it. If you move in and live there, the rules shift. If you rent it out, depreciation starts eating into that stepped-up basis. And if the estate gets complicated — multiple heirs, a house that needs work, a contested will — the clean step-up can get messy fast. I've seen families blow the advantage by renting the inherited home for a year "to figure things out."

How to avoid paying capital gains tax on the sale of a rental property

You generally can't use the primary residence exclusion on a pure rental. But there are legitimate paths.

The most common is the 1031 exchange: sell the rental and roll the proceeds into a like-kind investment property within the required window, and the gain is deferred. It's not eliminated — it's pushed forward, and if you keep exchanging, it can be deferred for a very long time. You can also convert the property to your primary residence and live in it long enough to qualify for a partial exclusion, though the rules around how much counts are strict and depreciation recapture follows you either way.

What you cannot escape is depreciation recapture. Every year you claimed depreciation on that rental, you were lowering your basis — and when you sell, that depreciation gets taxed back, generally at a rate higher than standard long-term capital gains. This is what got me. I'd mentally filed the depreciation as a freebie. It wasn't. It was a loan against future tax that came due all at once.

The 3.8% surtax and when it kicks in

There's a separate tax on net investment income, and home sale gains can fall under it if your income is high enough. The threshold sits at $200,000 for single filers and $250,000 for married filing jointly, based on modified adjusted gross income.

The surtax applies to the lesser of your net investment income or the amount by which your income exceeds the threshold. So a large home sale gain can push you over, and the surtax adds 3.8% on top of the capital gains rate you already owe.

Is it a big deal? On a $54,000 taxable gain, 3.8% is about $2,000. Not catastrophic. But if you're selling a second home or a rental with a six-figure gain, it's the difference between a manageable bill and a painful one — and it's the kind of thing that catches people who never thought of themselves as high income.

The question worth asking before you list

Most sellers spend months thinking about the listing price and about eleven minutes thinking about the tax. That's backwards.

Pull your improvement receipts. Reconstruct your basis. Run the exclusion against a realistic sale price and see whether you land under the line or over it. If you're close, the timing of a sale, the documentation you can assemble, or a conversation with a tax professional could change the outcome materially.

The rule that matters most isn't complicated: live in the house, keep your paperwork, and know where your number sits relative to $250,000 or $500,000. Everything else is detail. And the detail is where the money quietly walks out the door.

Hannah Fairbanks

Hannah Fairbanks

Hannah Fairbanks is a residential market analyst and advisor who specializes in home valuation, buyer and seller advisory, and urban housing policy. She helps clients navigate shifting market trends with clear, data-driven guidance tailored to their goals. Her work blends rigorous analysis with a personable approach, making complex housing decisions feel manageable.

See all articles →

Related articles