Capital Gains and Investment Tax
Capital gains on a home sale: how the $250,000 exclusion works
Short answer
Most people owe no capital gains on a home sale: if you owned and lived in the home as your main home for at least 24 months of the 5 years before the sale, you can exclude up to $250,000 of gain, or $500,000 on a joint return (IRS Tax Topic 701). Only gain above the exclusion is taxed, and a loss is not deductible.
- 01Exclusion, single
- Up to $250,000 of gain
- 02Exclusion, married filing jointly
- Up to $500,000 of gain
- 03Ownership and use tests
- 24 months each within the 5 years before the sale
- 04How often
- Not if you excluded gain on another home in the prior 2 years
- 05Loss on a main home
- Not deductible
- 06Forms if gain is taxable
- Form 8949 and Schedule D (Form 1040)
Do I pay capital gains when I sell my house?
Usually not, if the house was your main home. The home sale exclusion, found in section 121 of the Internal Revenue Code, lets you exclude up to $250,000 of gain from income, or up to $500,000 if you file jointly with your spouse (IRS Tax Topic 701). Capital gains on home sale are owed only on the profit above that amount, or on the whole profit if you fail the tests.
The exclusion amounts are not indexed for inflation, so they are the same for capital gains on home sale 2026 transactions as in earlier years. Any taxable part is a capital gain: long-term if you owned the home more than one year, short-term if not.

Who qualifies for the section 121 exclusion?
You qualify for the full section 121 exclusion if you pass both the ownership test and the use test and have not used the exclusion recently. The 24 months do not have to be consecutive, and the two tests do not have to cover the same 24 months.

- Ownership test: you (or your spouse, for a joint claim) owned the home for at least 24 months of the 5 years ending on the sale date.
- Use test: you lived in it as your main home for at least 24 months of those 5 years. For the $500,000 joint exclusion, both spouses must meet the use test and at least one must meet the ownership test.
- Look-back test: you did not exclude gain from selling another home in the 2 years before this sale.
- Military and certain other service members: on qualified official extended duty, you can elect to suspend the 5-year period for up to 10 years (IRS Tax Topic 701).
How do I figure my gain and basis on a home sale?
Gain is the amount realized minus your adjusted basis. The amount realized is the sale price minus selling expenses such as real estate commissions and legal fees. Adjusted basis starts with what you paid and grows with qualifying improvements (IRS Publication 523).
| Adds to basis | Does not add to basis |
|---|---|
| Purchase price, or land cost plus building cost if you built it | Routine repairs such as painting, fixing leaks, patching cracks |
| Settlement and closing costs when you bought, except financing costs | Fire and casualty insurance premiums |
| Improvements that add value, prolong useful life or adapt the home to new uses, such as a new roof, addition or kitchen remodel | Loan points and other costs of getting the mortgage |
Worked example
- Bought in 2012 for $300,000 plus $6,000 of non-loan closing costs.
- Added a new roof and remodeled the kitchen for $45,000. Adjusted basis: $351,000.
- Sold in 2026 for $700,000 and paid $38,000 in commissions and fees. Amount realized: $662,000.
- Gain: $662,000 minus $351,000 = $311,000.
- Single owner: $250,000 excluded, $61,000 taxable as a long-term gain. Married couple filing jointly who both lived there: all $311,000 excluded.
Keep receipts for improvements for as long as you own the home and at least three years after filing the return for the sale year. Without records, you may not be able to prove a higher basis.
What if I lived there less than two years?
You may still get a reduced exclusion if the main reason for the sale was a work move, health, or an unforeseeable event (IRS Publication 523). Selling early for other reasons, such as wanting a bigger house, generally means no exclusion.
- Work: you took or were transferred to a new job at a location at least 50 miles farther from the home than your old work location.
- Health: you moved to obtain or provide diagnosis, treatment or care for a disease, illness or injury.
- Unforeseeable events: examples include destruction of the home, a casualty, death, divorce or unemployment.
The reduced maximum equals your qualifying time divided by 24 months (or 730 days), multiplied by $250,000. For example, a single owner who lived in a home for 12 months and then moved 300 miles for a new job can exclude up to 12/24 x $250,000 = $125,000. If her gain is $80,000, none of it is taxed.
When is part of a home sale gain taxable even with the exclusion?
Three situations can leave some gain taxable even when you pass the tests. They mostly affect people who rented out the home or used part of it for business.
- Depreciation: gain equal to depreciation allowed or allowable after May 6, 1997, for a home office or rental use, cannot be excluded. It is taxed as unrecaptured section 1250 gain at up to 25%.
- Nonqualified use: periods after 2008 when the home was not your main home, such as years it was a rental before you moved in, reduce the gain you can exclude.
- Gain above the cap: anything over $250,000 or $500,000 is taxed at the long-term rates of 0%, 15% or 20% shown on the 2026 capital gains tax rate page.
A taxable home gain stacks on top of your other income the same way qualified dividends and investment gains do. If your modified adjusted gross income is above $200,000 single or $250,000 joint, the taxable part can also be subject to the 3.8% net investment income tax.
How do I report a home sale on my tax return?
You must report the sale if you received Form 1099-S, Proceeds From Real Estate Transactions, or if any part of the gain is taxable (IRS Tax Topic 701). If the full gain is excluded and no Form 1099-S was issued, you generally do not report the sale.
- Find the sale date in box 1 and gross proceeds in box 2 of Form 1099-S, if you received one.
- Figure your gain with the worksheets in IRS Publication 523, Selling Your Home.
- Enter the sale on Form 8949, Sales and Other Dispositions of Capital Assets, and show the excluded amount as an adjustment.
- Carry the totals to Schedule D (Form 1040), Capital Gains and Losses.
- If a large taxable gain means you will owe $1,000 or more, consider an estimated payment for the quarter of the sale.
What if my situation is different?
- Spouse died: a surviving spouse who has not remarried can still claim up to $500,000 if the home is sold within 2 years of the death and the other requirements are met (IRS Publication 523).
- Sold at a loss: a loss on your own home is not deductible and does not offset other gains.
- Owned less than a year: any taxable gain is short-term and taxed at ordinary rates; see short-term capital gains tax.
- Inherited home you never lived in: the exclusion does not apply, but the gain is long-term automatically. The capital gains tax guide covers inherited assets.
Common questions
Do I have to buy another house to avoid capital gains?
No. The old rollover rule that required buying a replacement home ended decades ago. The current home sale exclusion applies whether you buy another home, rent or move in with family.
How many times can you use the $250,000 home sale exclusion?
There is no lifetime limit. You can use it again as long as you meet the ownership and use tests and did not exclude gain on another home in the 2 years before the sale.
Is the $500,000 home sale exclusion per person?
No. It is $500,000 per married couple filing jointly, and both spouses must have lived in the home for 24 months of the last 5 years. Single owners get $250,000.
Do seniors pay capital gains on a home sale?
The same rules apply at every age; there is no separate over-55 exclusion anymore. Seniors who pass the 2-out-of-5-year tests exclude up to $250,000 or $500,000 like anyone else.
Does a home sale count as income for Social Security or Medicare?
Excluded gain is not included in income. Any taxable gain above the exclusion does raise adjusted gross income, which can affect the taxable share of Social Security and income-based Medicare premiums.
Sources
- Tax Topic 701, Sale of your home irs.gov
- Publication 523, Selling Your Home irs.gov
- Tax Topic 409, Capital gains and losses irs.gov
- Publication 505, Tax Withholding and Estimated Tax irs.gov
We check figures against these official pages. Rules change; confirm anything that affects a deadline or payment with the agency before you act.
Tell us what happened
Describe your situation and our editors will use it to improve this guide. If you leave your email, we may reply with a pointer to the right page or official contact. We never share your details.