When you sell a home, it is easy to assume the IRS will either ignore it completely or take a huge bite out of your profit. The truth is usually somewhere in the middle. Many homeowners owe zero federal capital gains tax thanks to the home sale exclusion (also called the Section 121 exclusion), but only if you meet a couple of rules and keep decent records. And there are common exceptions, especially if the home was ever rented out, you claimed depreciation, or your gain is unusually large.

In this guide, I will walk you through the exclusion limits, the ownership and use tests, how to calculate your basis (including what counts as an improvement), and the reporting basics that trip people up.

A homeowner sitting at a kitchen table reviewing closing documents with a real estate agent, natural light, candid real photo

The home sale exclusion (the part everyone wants)

If the home you sold was your primary residence, you may be able to exclude some or all of your gain from federal income taxes.

Exclusion limits

  • $250,000 of gain can be excluded if you are single or married filing separately.
  • $500,000 of gain can be excluded if you are married filing jointly.

These are exclusions of gain, not sale price. If you sell for $450,000, that does not mean you automatically get a $450,000 exclusion. You only exclude the profit after factoring in your basis and selling costs.

The ownership and use tests (2 out of 5 rule)

To qualify for the full exclusion, you generally must meet both tests:

  • Ownership test: You owned the home for at least 2 years during the 5-year period ending on the sale date.
  • Use test: You lived in the home as your primary residence for at least 2 years during that same 5-year period.

The 2 years do not have to be consecutive. Think of it like a running total inside a 5-year window.

The “once every two years” limit

In most cases, you cannot claim the exclusion if you claimed it on another home sale within the 2-year period before this sale.

Special situations where you might still qualify

Life happens. The IRS allows a partial exclusion in certain cases even if you do not meet the full 2-year requirements, commonly when you sell due to:

  • A change in workplace location
  • Health-related reasons
  • Unforeseen circumstances (for example, certain family changes or disasters)

If you are in one of these scenarios, it is worth slowing down and either reviewing IRS rules carefully or talking to a tax pro. A partial exclusion can still wipe out a big chunk of the gain.

Widows and widowers: a timing window to know

If your spouse died and you are selling the home, there is a special rule that can matter a lot. In many cases, a surviving spouse can still use the full $500,000 exclusion, as long as the sale happens within 2 years of the spouse’s death, you have not remarried before the sale, and the other requirements are met. If you are in this situation, double-check the timing before you list the home.

What “capital gain” means on a home sale

Your capital gain is basically:

Sale price minus selling costs minus adjusted basis.

If you want the formal term, your sale price minus selling costs is essentially your amount realized. The exclusion applies to the gain number. So, to estimate whether you will owe anything, you need a decent handle on two things:

  • Your selling costs
  • Your adjusted cost basis
A homeowner sorting paper receipts and contractor invoices on a kitchen table with a laptop open, real photo

Cost basis: the number that can save you thousands

Basis is one of those tax words that sounds intimidating, but the idea is simple. Your basis is what you have invested in the home for tax purposes.

Start with your original basis

For most homeowners, your starting basis is what you paid for the home, plus certain purchase costs.

Common items that can increase your original basis:

  • Purchase price
  • Title insurance and certain title fees
  • Legal fees related to the purchase
  • Recording fees
  • Transfer taxes

Items that usually do not increase basis:

  • Homeowners insurance
  • Utility bills
  • Mortgage interest
  • Property taxes (those are generally deductions, not basis)

Then calculate your adjusted basis

Your adjusted basis is your original basis, plus qualifying improvements, plus certain other adjustments.

For most people, the big lever is improvements.

Improvements vs repairs

A quick rule of thumb:

  • Improvements add value, extend the life of the property, or adapt it to new uses. These typically increase your basis.
  • Repairs keep the home in good working condition. These typically do not increase your basis.

Examples of improvements that typically count

  • Adding a room or finishing a basement
  • Remodeling a kitchen or bathroom (not just replacing a broken faucet)
  • New roof
  • New HVAC system
  • New windows (whole-house upgrades)
  • Adding a deck, patio, or fence
  • Major landscaping that adds value, like a retaining wall or irrigation system
  • Accessibility upgrades, like ramps or wider doorways

Examples of repairs that typically do not count

  • Fixing a leak
  • Painting a room
  • Replacing a few broken tiles
  • Patching a driveway
  • Basic yard maintenance

My practical tip: If the work was a “big project” where you hired a contractor, pulled permits, or replaced a major system, it is worth checking whether it qualifies as an improvement and keeping the paperwork.

What about improvements you made years ago?

Still count, as long as you can reasonably document them. The IRS does not require a specific format, but receipts, invoices, permits, and before-and-after photos are your friend.

Selling costs: the overlooked gain reduction

Selling your home is expensive. The good news is many selling expenses reduce your gain.

Common selling costs include:

  • Real estate agent commissions
  • Seller-paid closing costs
  • Transfer taxes paid by the seller
  • Attorney fees related to the sale
  • Advertising fees
  • Credits to the buyer at closing (for example, a repair credit or closing cost credit that reduces what you actually receive)

These are not part of your basis, but they do reduce the gain because they reduce the net amount you walk away with from the sale. Some “repairs” are just personal maintenance, while other concessions are structured as credits on the settlement statement. How it is shown at closing matters, so keep your final Closing Disclosure and any addenda.

A simple home sale gain example

Let’s say:

  • You bought your home for $280,000.
  • You paid $5,000 in qualifying purchase costs.
  • You later put in a $25,000 kitchen remodel that qualifies as an improvement.
  • You sell for $450,000.
  • You pay $30,000 in commissions and other selling costs.

Adjusted basis = $280,000 + $5,000 + $25,000 = $310,000

Net sale proceeds = $450,000 - $30,000 = $420,000

Gain = $420,000 - $310,000 = $110,000

If you qualify for the home sale exclusion, that $110,000 gain is typically fully excludable, meaning you likely owe no federal capital gains tax on the sale.

Reporting basics: when you must report the sale

A very common misconception is, “If I qualify for the exclusion, I do not have to report anything.” Sometimes that is true, sometimes it is not.

Watch for Form 1099-S

After closing, you may receive Form 1099-S, which reports the gross proceeds of the sale to the IRS. If the IRS gets a 1099-S and your tax return does not reflect the sale appropriately, you can trigger a notice.

Whether you receive a 1099-S depends on the transaction and the closing agent. If you do receive it, assume you should address the sale on your return, even if the gain is fully excluded.

Do I need to report it? A simple checklist

  • Fully excluded gain and no 1099-S: you usually do not need to report the sale.
  • You received a 1099-S: you generally should report the sale, even if the gain is excluded.
  • Any taxable portion: you must report it. This often includes gains above the exclusion limit and certain rental or depreciation situations.

Typical forms used

If you need to report the sale, it is commonly handled through:

  • Form 8949 and Schedule D for capital gains and losses (often used when there is a taxable portion, or when reporting is needed because of a 1099-S)
  • Related worksheets or entries in your tax software for the home sale exclusion

Tax software usually walks you through this. The key is having your numbers ready: purchase price, improvements, and selling costs.

Important: State taxes can differ. Some states treat home sale gains differently or have their own reporting requirements.

Common mistakes that lead to surprise taxes

1) Confusing “profit” with “cash you received”

Paying off a mortgage does not reduce your gain. If you sell and most of the proceeds go to your lender, the IRS still looks at sale price, costs, and basis.

2) Missing the 2-out-of-5 window

If you moved out and rented the house for a few years before selling, you can accidentally fall outside the use test. Put the key dates on a calendar before you list the home.

3) Getting hit by rental rules (depreciation and “nonqualified use”)

If you rented the home and claimed depreciation, that depreciation is generally not excludable and is typically taxed (often up to 25%), even if you qualify for the home sale exclusion. Also, certain periods of “nonqualified use” (commonly rental or vacation use after 2008) can reduce how much gain you are allowed to exclude. This is one of the biggest sources of “wait, why do I owe tax?” surprises.

4) Forgetting to track improvements

When you do not increase your basis for qualifying improvements, your taxable gain can look much larger than it should.

5) Counting repairs as improvements

I get it. A $6,000 plumbing repair feels like it should count. But routine repairs generally do not increase basis. Overstating basis can create problems if you are audited.

6) Not keeping documentation

In a perfect world, you would have every receipt. In the real world, do your best. Save:

  • Closing disclosures from purchase and sale
  • Receipts and invoices for improvements
  • Permits (if any)
  • Photos of major projects

7) Assuming “married” automatically means $500,000

Generally, the $500,000 exclusion is for married filing jointly. In broad terms, the usual rule is that both spouses meet the use test, at least one spouse meets the ownership test, and neither spouse claimed the exclusion on another home sale within the last 2 years. The details matter, especially when one spouse meets the ownership test and the other meets the use test, or if there was a prior exclusion claimed. If your situation is even a little complicated, it is worth verifying.

Quick checklist before you sell

  • Confirm your key dates to meet the ownership and use tests.
  • Find your original closing disclosure from when you bought the home.
  • Gather improvement receipts, invoices, and permits.
  • Estimate selling costs, especially commissions and seller-paid fees.
  • Ask your closing agent whether a Form 1099-S will be issued.
A real estate agent handing house keys to a smiling homeowner at the front door of a suburban home, real photo

When to consider professional help

Plenty of home sales are simple enough for good tax software. But I would strongly consider a CPA or enrolled agent if:

  • You used the home as a rental at any point and claimed depreciation (or could have claimed it). Depreciation after 5/6/1997 is generally not excludable, even if the rest of your gain is.
  • You are selling after a divorce or a spouse’s death.
  • You do not meet the full 2-year tests and think you may qualify for a partial exclusion.
  • You have a very large gain near or above the $250,000 or $500,000 limits.

Paying for an hour of expert help can be cheaper than paying thousands in avoidable tax.

Marcus note: I am all for DIY money moves, but taxes are one area where “close enough” can get expensive fast. If you are unsure about your basis or eligibility, get clarity before you file.

Bottom line

The home sale exclusion is one of the best tax breaks out there, but it is not automatic. If you understand the 2-out-of-5 rules, track improvements that raise your basis, and keep your closing paperwork, you are giving yourself the best shot at legally paying $0 in capital gains tax when you sell.

If you want one action item today, make it this: create a simple “home receipts” folder and drop in your closing documents plus any major improvement invoices. Future you will be very grateful at tax time.