Key takeaways
- Most sellers owe no federal tax on a home sale because Section 121 lets you exclude up to $250,000 of gain, or $500,000 on a joint return.
- To qualify you generally must have owned the home and lived in it as your main home for at least two of the five years before the sale.
- Your taxable gain is the sale price minus selling expenses minus your adjusted basis, so receipts for improvements can save you real money.
- Depreciation from renting the home or using it for business after May 6, 1997 can never be excluded and is taxed at up to 25%.
- If you receive a Form 1099-S, you must report the sale on Form 8949 and Schedule D even if all of your gain is excluded.
This guide is for homeowners, especially people selling without an agent, who want to know whether the profit from a home sale will be taxed. After reading it, you’ll be able to test yourself against the IRS eligibility rules, calculate your adjusted basis and gain, and recognize the situations, like a former rental or a quick move, that need a closer look before you sign a contract.
How the home sale exclusion works
Section 121 of the tax code lets you exclude up to $250,000 of gain from the sale of your main home, or $500,000 if you’re married filing jointly. The exclusion applies to your profit, not the sale price. A couple who bought for $300,000 and sells for $700,000 has a $400,000 gain before expenses, and that can be entirely tax-free.
Two details catch people off guard. First, these dollar limits were set in 1997 and have never been indexed for inflation, so long-time owners in fast-appreciating markets increasingly blow past them. Second, the exclusion only covers your main home. A vacation cabin or a pure rental doesn’t qualify on its own.
Proposals to raise or eliminate the cap have been introduced in Congress. Unless one becomes law, plan around the $250,000 and $500,000 limits.
The eligibility test: ownership, use, and the look-back rule
IRS Publication 523 boils eligibility down to a few tests, all measured in the five years ending on the sale date.
Ownership and use
- Ownership test: You owned the home for at least 24 months (730 days) of the five years.
- Use test: You lived in it as your main home for at least 24 months of the same five years.
The two periods don’t have to be continuous, and they don’t have to overlap. You could live in a house as a renter for two years, buy it from your landlord, move out, and sell it two years later. Both tests are met inside the five-year window.
Married couples
To claim the full $500,000 on a joint return, either spouse can meet the ownership test, but both spouses must meet the use test, and neither can have used the exclusion on another home in the prior two years. If only one spouse qualifies, that spouse can generally still claim up to $250,000.
The two-year look-back
You generally can’t use the exclusion if you excluded gain from another home sale during the two years before this sale. Flippers who move every 18 months run into this rule constantly.
Special situations
A surviving spouse who hasn’t remarried can generally still claim up to $500,000 if the home sells within two years of the spouse’s death. Members of the uniformed services and Foreign Service on qualified extended duty can elect to suspend the five-year window for up to 10 years.
Run through this quick self-check before you list:
- Have you owned the home for at least 24 of the last 60 months?
- Have you lived in it as your main home for at least 24 of those months?
- Have you avoided claiming the exclusion on a different home in the last two years?
- If you’re married and filing jointly, did both of you live there for 24 months?
- Did you ever rent the home or claim depreciation for a home office? If yes, read the rental section below.
Calculating your gain: basis, improvements, and selling expenses
Your gain is the amount realized minus your adjusted basis.
Adjusted basis starts with what you paid for the home, plus certain settlement costs from your purchase (such as owner’s title insurance, recording fees, and transfer taxes you paid as buyer). Then you add the cost of improvements, meaning work that adds value, prolongs the home’s life, or adapts it to new uses: an addition, a new roof, a kitchen remodel, central air, a fence. You subtract items like depreciation you claimed and deducted casualty losses.
Repairs and maintenance don’t count. Painting a bedroom or fixing a leak keeps the home in good condition but doesn’t add to basis. The exception is repair-type work done as part of an extensive remodel or restoration, which can be added.
Amount realized is the sale price minus selling expenses: commissions, advertising, legal fees, title and settlement charges you pay as seller, and similar costs. If you’re estimating proceeds, our seller net proceeds calculator gives you the selling-expense side of the equation.
The practical lesson is to dig up your old closing statement and every receipt for major work. A $40,000 remodel you can’t document is a $40,000 basis increase you may not be able to defend.
Worked example: when the exclusion runs out
Here’s an illustrative example of a long-time owner in a high-appreciation market. The same numbers are shown for a married couple filing jointly and for a single owner.
| Line item | Married filing jointly | Single seller |
|---|---|---|
| Original purchase price (2012) | $310,000 | $310,000 |
| Purchase settlement costs added to basis | $6,000 | $6,000 |
| Improvements (kitchen $45,000, roof $18,000, deck $12,000) | $75,000 | $75,000 |
| Adjusted basis | $391,000 | $391,000 |
| Sale price (2026) | $985,000 | $985,000 |
| Selling expenses (commission, title, transfer tax) | $52,000 | $52,000 |
| Amount realized | $933,000 | $933,000 |
| Gain | $542,000 | $542,000 |
| Section 121 exclusion | $500,000 | $250,000 |
| Taxable long-term capital gain | $42,000 | $292,000 |
Because the home was held for more than a year, the taxable portion is a long-term capital gain, taxed at 0%, 15%, or 20% depending on your income. At 15%, the couple’s bill would be about $6,300.
Higher earners may also owe the 3.8% net investment income tax. It applies only to gain that isn’t excluded, and only if your modified adjusted gross income exceeds $250,000 on a joint return or $200,000 for single filers. Excluded gain is never subject to it.
Notice what moved the needle. Without the $75,000 of documented improvements, the couple’s taxable gain would have been $117,000 instead of $42,000.
Partial exclusion when you have to sell early
If you fail the two-year tests, you may still qualify for a reduced exclusion when the main reason for the sale was one of three things:
- A change in workplace location. The IRS safe harbor is met if your new job is at least 50 miles farther from the home than your old job was, or at least 50 miles from the home if you had no previous job. A spouse’s or co-owner’s job change counts too.
- A health issue, such as moving to get or provide treatment for yourself or a family member.
- An unforeseeable event, as defined in IRS guidance.
If you don’t fit a safe harbor, you can still qualify under a facts-and-circumstances test, for example by showing the situation arose while you lived there, you sold soon after, and you couldn’t have anticipated it when you bought.
The math is a proration. Take the shortest of your ownership period, your use period, or the time since you last used the exclusion, and divide by 24 months. Multiply by $250,000.
Example: A single owner lived in a condo for 15 months, then took a job 200 miles away. The cap is 15 ÷ 24 × $250,000 = $156,250. If the actual gain is $60,000, all of it is excluded. The reduced amount is a ceiling, not a cut to your gain.
Former rentals and home offices: depreciation and nonqualified use
This is where most surprise tax bills come from.
Depreciation is always taxable
You can’t exclude the part of your gain equal to depreciation allowed or allowable for periods after May 6, 1997. “Allowable” matters: if you rented the home and never claimed depreciation, the IRS still treats you as if you had. That gain is reported as unrecaptured Section 1250 gain and taxed at a maximum rate of 25%.
If a home office was inside your living space rather than a separate structure, you generally don’t split the gain between business and personal use, but any depreciation you took for the office is still taxable.
Renting after you move out
Suppose you lived in a home from June 2019 until June 2022, rented it out, and sold it in March 2025. Because you lived there two of the five years before the sale, you still pass the use test. Renting after your last day as a resident isn’t treated as nonqualified use. If your gain is $180,000 and you claimed $21,000 of depreciation, about $159,000 is excluded and $21,000 is taxed at up to 25%. Wait more than three years after moving out, though, and you fail the use test entirely.
Renting before you move in
The reverse order is costlier. Any period after 2008 when neither you nor your spouse used the home as a main residence is nonqualified use, and gain allocated to it can’t be excluded. Say you owned a house for 10 years, rented it for the first 4 (starting in 2016), then lived in it for 6. Roughly 40% of the gain, after separating out depreciation, is taxable even though you pass the two-of-five test.
Reporting the sale: Form 1099-S, Form 8949, and Schedule D
The closing agent may issue Form 1099-S, which reports the sale date and gross proceeds to the IRS. You must report the sale on your return if:
- you have any gain you can’t exclude, or
- you received a Form 1099-S, even if the entire gain is excludable.
Report it on Form 8949 and Schedule D, showing the exclusion. If your whole gain is excludable and no 1099-S was issued, you generally don’t report the sale. When your entire gain is excludable, the closing agent generally doesn’t have to file a 1099-S and may ask you to sign a certification to that effect. If one is issued anyway, report the sale.
State taxes and other wrinkles
Most states with an income tax start from your federal adjusted gross income, so the federal exclusion usually flows through. A few states have no income tax at all, and some apply their own adjustments, so check your state revenue department’s guidance for the year you sell. Rules vary by state, so confirm with a CPA or enrolled agent if your gain approaches the limits.
Keep your purchase closing statement, your improvement receipts, and your sale closing statement together for as long as you might need to prove basis. A by-owner sale doesn’t change any of these tax rules; you’re simply the one who has to keep the paperwork straight.
Next steps
- Estimate your take-home amount with the seller net proceeds calculator.
- See which expenses reduce your gain in seller closing costs explained.
- Gather your purchase and improvement records with the documents needed to sell a house by owner guide.
- If you have a former rental or a gain near the cap, find a vetted tax pro before you list.
Frequently asked questions
Do I have to buy another home to avoid capital gains tax?
No. The old rollover rule was replaced in 1997 by the Section 121 exclusion, which has no reinvestment requirement. You can sell, rent, or downsize and still use the exclusion if you pass the ownership and use tests.
Do I have to report my home sale if all of the gain is excluded?
Only if you received a Form 1099-S or have gain you cannot exclude. If you got a 1099-S, report the sale on Form 8949 and Schedule D and show the exclusion so the IRS can match the form.
Can I deduct a loss when I sell my home for less than I paid?
No. A loss on the sale of your personal residence is not deductible. Losses are deductible only on property held for investment or business use.
What if I lived in the home for less than two years?
You may still qualify for a reduced exclusion if the main reason for selling was a job change, a health issue, or an unforeseeable event. The cap is prorated by how long you owned and used the home out of 24 months.
Does the exclusion apply to a vacation home or rental property?
Not directly. It applies only to your main home. A former rental or second home can qualify only after it becomes your main home and passes the tests, and part of the gain may still be taxable under the nonqualified use and depreciation rules.
Sources
- IRS Publication 523, Selling Your Home
- IRS Topic No. 701, Sale of Your Home
- IRS Questions and Answers on the Net Investment Income Tax
- IRS Publication 544, Sales and Other Dispositions of Assets