When homeowners sell their primary residence, the IRS allows them to exclude up to $250,000 of capital gain from gross income — or up to $500,000 for married couples filing jointly — provided they meet the ownership and use test. Most people who have lived in their home for several years pay little or no federal tax on the sale.
This is general information, not tax advice — consult a qualified tax professional about your specific situation.
The Section 121 Exclusion at a Glance
Internal Revenue Code Section 121 is the provision that makes selling a home one of the most tax-favored transactions available to individual taxpayers. The exclusion is not a deduction — it removes the qualifying gain from income entirely, so it cannot be offset by other capital losses or phased out by income level.
| Filing Status | Maximum Gain Excluded |
|---|---|
| Single | $250,000 |
| Married Filing Jointly | $500,000 |
| Married Filing Separately | $250,000 per spouse (if each meets both tests independently) |
| Head of Household | $250,000 |
The exclusion applies to gain, not to the sale price. A homeowner who sells for $600,000 after purchasing for $350,000 has $250,000 of gain before adjustments. If that homeowner is single and meets the requirements, the full gain is excluded and no federal tax is owed on the transaction.
The Ownership and Use Test
To qualify for the Section 121 exclusion, homeowners must meet two separate requirements during the five-year period ending on the date of sale:
- Ownership test — The homeowner must have owned the home for at least 24 months (two years).
- Use test — The homeowner must have used the home as their main home for at least 24 months (two years).
The two years do not need to be continuous. Periods of ownership and use can be combined from non-consecutive intervals, as long as the total reaches 24 months within the five-year lookback window. Short temporary absences — such as vacations — generally count as periods of use even if the homeowner is away.
Married couples filing jointly qualify for the $500,000 exclusion if at least one spouse meets the ownership test and both spouses meet the use test, and neither spouse has used the exclusion within the prior two years on a different home.
IRS Publication 523, Selling Your Home covers the ownership and use requirements in detail, including rules for homes held in trusts, disability exceptions, and surviving-spouse provisions.
The Once-Every-Two-Years Limit
Homeowners generally may not use the Section 121 exclusion more than once in any two-year period. The two-year clock runs from the date of the most recent prior sale on which the exclusion was claimed. A homeowner who sold one primary residence and claimed the exclusion in January 2024 could not claim it again on a second home sale before February 2026, even if that second home independently meets the ownership and use test.
How to Calculate Your Gain
Understanding what the IRS means by "gain" requires two figures: the amount realized from the sale and the adjusted basis of the home.
Amount Realized = Sale Price minus Selling Expenses
Selling expenses that reduce the amount realized typically include:
- Real estate agent commissions
- Title insurance and closing fees paid by the seller
- Legal fees and transfer taxes
Adjusted Basis = Purchase Price plus Qualifying Additions minus Depreciation Claimed
The basis of a home starts with its original purchase price (including certain closing costs paid at acquisition, such as title search fees and recording fees). Homeowners increase their basis by adding the cost of capital improvements made during ownership. The IRS distinguishes capital improvements — which add value, adapt the home to a new use, or extend its useful life — from routine repairs and maintenance, which are not added to basis.
Examples of qualifying improvements that increase basis:
- Adding a bedroom, bathroom, or garage
- Installing a new roof or HVAC system
- Finishing a basement or attic
- Building a deck or swimming pool
- Major kitchen or bathroom renovation
Gain = Amount Realized minus Adjusted Basis
Worked Example
| Item | Amount |
|---|---|
| Sale price | $575,000 |
| Less: agent commission (5%) | ($28,750) |
| Less: other closing costs paid by seller | ($3,500) |
| Amount realized | $542,750 |
| Original purchase price (2014) | $310,000 |
| Plus: kitchen renovation (2019) | $45,000 |
| Plus: roof replacement (2021) | $18,000 |
| Adjusted basis | $373,000 |
| Gain | $169,750 |
In this example, a single homeowner who meets the ownership and use test would exclude the full $169,750 of gain under Section 121 — well within the $250,000 cap — and owe no federal tax on the sale.
You Cannot Deduct a Loss on a Personal Residence
If a homeowner sells their primary residence for less than its adjusted basis, the loss is not deductible for federal income tax purposes. The tax rules treat a personal-use asset differently from investment property. Homeowners who sell at a loss receive no tax benefit from that loss. This treatment applies regardless of the size of the loss or the circumstances of the sale.
For guidance on how gains and losses are treated on investment property, see our guide to capital gains tax explained.
Partial Exclusion for Special Circumstances
Homeowners who do not fully meet the two-year ownership and use test may still qualify for a partial exclusion if the sale is due to:
- A change in place of employment — the homeowner or a qualified individual has a new job or job transfer that is at least 50 miles farther from the old home than the previous workplace was
- Health — a physician recommends the move, or a qualified individual has a disease, illness, or injury that necessitates the change of residence
- Unforeseen circumstances — events the homeowner could not reasonably have anticipated before buying and occupying the home (examples in IRS guidance include natural disasters, death, divorce, and multiple births from a single pregnancy)
The partial exclusion is calculated as a fraction: the number of qualifying months of ownership or use (whichever is shorter) divided by 24, multiplied by the applicable maximum exclusion ($250,000 or $500,000). A single homeowner who lived in the home for 12 months and then relocated for a new job would be eligible for up to $125,000 of exclusion (12 / 24 x $250,000).
IRS Topic No. 701, Sale of Your Home outlines the partial-exclusion rules and the list of unforeseen circumstances recognized by the IRS.
Depreciation Recapture for Home Office or Rental Use
Homeowners who claimed depreciation deductions on any portion of their home — such as through a home office deduction or by renting out part of the property — may face depreciation recapture upon sale. The portion of the gain attributable to depreciation previously taken (or allowable to be taken) is taxed as ordinary income at a maximum rate of 25 percent, regardless of how long the homeowner owned the property.
The Section 121 exclusion does not shelter depreciation recapture. A homeowner who claimed $12,000 in home-office depreciation over the years would owe tax on that $12,000 of gain even if the remaining gain falls within the exclusion limit.
Homeowners with any history of home-office or rental use should review their depreciation records carefully before the sale closes. Our overview of tax deductions for homeowners covers the home-office deduction in more detail.
Inherited Homes and the Stepped-Up Basis
When a homeowner inherits a property, the tax rules generally allow the heir to "step up" the basis to the fair market value of the home on the date of the original owner's death. This stepped-up basis means that much or all of the appreciation that occurred during the deceased owner's lifetime is never subject to capital gains tax.
For example, a parent who purchased a home for $100,000 and died when it was worth $450,000 passes that home to an heir with a basis of $450,000. If the heir sells it for $470,000 shortly after, the taxable gain is only $20,000 — not $370,000.
The heir who later sells an inherited home must still apply the standard capital-gains rules to any gain above the stepped-up basis. The Section 121 ownership and use test applies to the heir's own period of ownership and use, not the decedent's.
Form 1099-S and Reporting on Schedule D
Not every home sale needs to be reported on the tax return, but homeowners should not assume that silence equals safety.
A closing agent is generally required to file Form 1099-S, Proceeds From Real Estate Transactions, with the IRS and send a copy to the seller. If a seller certifies in writing at or before closing that the full gain is excludable under Section 121, the closing agent may be exempt from filing — but this exemption requires an affirmative written certification, not a verbal statement.
Homeowners must report the sale on Form 8949 and Schedule D of their federal return if any of the following is true:
- The gain exceeds the applicable exclusion ($250,000 single / $500,000 MFJ)
- A Form 1099-S was issued for the transaction
- The exclusion is being disallowed or reduced (such as due to partial non-qualifying use)
When the full gain is excluded and no Form 1099-S is issued, the sale generally does not need to appear on the return at all.
For a broader overview of how capital gains are taxed and reported, see our guide to capital gains tax basics and visit the TaxPros Rated newsroom for additional federal tax topics.
Frequently Asked Questions
Q: Do I have to live in the home for two consecutive years to qualify?
The two years of use do not need to be continuous. Homeowners can combine non-consecutive periods of use within the five-year window preceding the sale, as long as the total reaches 24 months. Short absences for vacations or work travel generally count toward the use requirement. This is general information, not tax advice — consult a qualified tax professional about your specific situation.
Q: My spouse and I file separately. Do we still get the $500,000 exclusion?
No. The $500,000 exclusion is available only to married couples filing a joint return. Each spouse filing separately is limited to $250,000, provided each individually meets the ownership and use test for their respective interest in the home. Filing status decisions can have significant consequences — consult a qualified tax professional about your specific situation.
Q: I used part of my home as a home office for several years. Does the exclusion cover the whole gain?
The Section 121 exclusion applies to the residential-use portion of the home. Depreciation previously claimed or allowed on the business-use portion is subject to depreciation recapture at ordinary income rates up to 25 percent, and the exclusion does not shelter that amount. The rules are detailed and depend on whether the business space was a separate structure or within the dwelling — consult a qualified tax professional about your specific situation.
Q: What if I sell my home at a loss?
A loss on the sale of a personal residence is not deductible for federal income tax purposes. The IRS treats personal-use property differently from business or investment property. There is no mechanism to carry the loss forward or offset it against other income or gains. This is general information, not tax advice — consult a qualified tax professional about your specific situation.
Q: Do I need to report the sale to the IRS even if I owe no tax?
If the entire gain is excluded under Section 121 and no Form 1099-S was issued for the transaction, homeowners generally are not required to report the sale on their federal return. However, if a Form 1099-S was issued, or if any portion of the gain exceeds the exclusion, the sale must be reported on Form 8949 and Schedule D. When in doubt, consult a qualified tax professional about your specific situation.
Q: Can I use the exclusion on a vacation home or investment property?
No. The Section 121 exclusion applies only to a home used as the taxpayer's main home — the place where the homeowner lives most of the time. A vacation home or rental property does not qualify unless it was also the taxpayer's primary residence for at least two of the five years before the sale. Gain from the sale of investment real estate may be eligible for different treatment under other tax provisions — consult a qualified tax professional about your specific situation.
This is general information, not tax advice — consult a qualified tax professional about your specific situation.