If you owned your main home and lived in it for at least 2 of the 5 years before the sale, you can generally exclude up to $250,000 of the gain from your income, or up to $500,000 for most married couples filing jointly. Your gain is the sale price minus selling costs minus your adjusted basis, which is what you paid plus certain closing costs and improvements. You report the sale on Form 8949 and Schedule D only if some gain is taxable or you receive a Form 1099-S.
Who gets the full exclusion
The exclusion applies only to your main home, and you have only one main home at a time. If you have more than one home, the main factor is where you spend the most time, though addresses on documents such as your voter registration and driver's license also count. A house, condo, co-op, mobile home or houseboat can qualify. To get the full amount, you must pass three tests, measured over the 5 years ending on the date of sale:
- Ownership: you owned the home for at least 24 months.
- Residence: you lived in it as your main home for at least 24 months (730 days). The time doesn't have to be in one stretch, and vacations and other short absences count as time living there.
- Look-back: you didn't exclude gain on another home sale during the 2 years before this sale.
Married couples filing jointly get up to $500,000 if either spouse meets the ownership test and both meet the residence and look-back tests. If only one of you qualifies, that spouse may still get $250,000.
You can't use the exclusion at all if you got the home through a like-kind (1031) exchange in the past 5 years, or if you are subject to the expatriate tax.
Special rules can help you meet the tests:
- Surviving spouses who haven't remarried can count the late spouse's ownership and residence time, and can use the $500,000 limit if they sell within 2 years of the death and the other conditions are met.
- Separated or divorced owners can count a former spouse's ownership time if the home was transferred to them. An owner can also count as residence the time a former spouse lives there under a divorce or separation agreement.
- Military, Foreign Service, intelligence community and Peace Corps members on qualified extended duty can suspend the 5-year period for up to 10 years.
- People who can no longer care for themselves and lived in the home at least 12 months of the 5 years can count time in a licensed care facility, such as a nursing home, as residence.
If you inherited the home, your starting basis is generally its fair market value on the date of death. Our guide to inheriting a house covers that rule and how to report the sale.
Selling sooner: the partial exclusion
If you don't meet the 2-year tests, you may still exclude part of the gain if the main reason for selling was one of these:
- Work: you, your spouse, a co-owner or another resident took a job at least 50 miles farther from the home than the old work location (or at least 50 miles away, if there was no previous job).
- Health: you moved to get or provide medical care for yourself or a family member, or a doctor recommended the move for a health problem.
- Unforeseeable events: the home was destroyed or condemned or damaged in a disaster, or someone living there died, divorced or legally separated, had twins or more from one pregnancy, became eligible for unemployment benefits, or could no longer pay basic living expenses because of a change in employment.
To figure the reduced limit, take the shortest of three periods: your time living in the home during the 5 years, your time owning it, and the time since you last sold a home with the exclusion. Divide it by 24 months and multiply by $250,000. A joint filer does this for each spouse and adds the two results. For example, someone who owned and lived in a home for 12 months before a qualifying job move could exclude up to 12 divided by 24, times $250,000, or $125,000.
Figuring your gain: amount realized minus adjusted basis
Start with the sale price and subtract your selling expenses, such as the agent's commission, advertising, legal fees and loan charges you paid that were the buyer's responsibility. The result is the amount realized. Then subtract your adjusted basis.
| Adds to basis | Doesn't add to basis |
|---|---|
| Purchase price, including the down payment and any amount you borrowed | Mortgage costs such as points, loan fees, lender-required appraisals and mortgage insurance |
| Some closing costs: owner's title insurance, legal and recording fees, survey fees, transfer taxes, abstract fees, charges to install utilities | Fire and casualty insurance premiums, and rent or utilities for living there before closing |
| Improvements still part of the home: additions, a new roof, central air, new siding, insulation, a kitchen remodel, landscaping, a fence, a driveway | Repairs and maintenance, such as painting or fixing leaks, unless they are part of a larger remodel |
| Special assessments for local improvements | Improvements you later removed, such as carpet you replaced |
You also subtract from basis any depreciation you took or could have taken for business or rental use, energy credits or utility subsidies tied to improvements, and casualty insurance payments. If the result is a loss, you can't deduct it, but you owe no tax on the sale either.
Hypothetical example: Maria and Joe, married filing jointly, bought their home in 2012 for $310,000 and paid $4,000 of closing costs that count toward basis. They added a new roof ($18,000), remodeled the kitchen ($45,000) and built a deck ($12,000). Repainting the house ($6,000) doesn't count. Their adjusted basis is $389,000. In 2026 they sell for $1,050,000 and pay $55,000 in commission and other selling costs, so the amount realized is $995,000. Their gain is $995,000 minus $389,000, or $606,000. They both lived there throughout, so $500,000 is excluded and $106,000 is taxable as a long-term capital gain. With $180,000 of wages and the $32,200 standard deduction, their 2026 taxable income is $253,800, so the whole $106,000 falls in the 15% capital gains bracket: $15,900. Their modified AGI of $286,000 is $36,000 over the $250,000 threshold for the 3.8% net investment income tax, adding $1,368. That is $17,268 of federal tax on the sale, before any state tax.
How a taxable gain is taxed
Gain on a home you owned for more than one year is long-term. For 2026, long-term gains are taxed at 0% while total taxable income stays at or below $49,450 for single filers ($98,900 for married couples filing jointly, $66,200 for heads of household), at 15% up to $545,500 ($613,700 joint, $579,600 head of household), and at 20% above that. Gain on a home owned one year or less is short-term and taxed at ordinary income rates.
The 3.8% net investment income tax applies to the smaller of your net investment income or the amount your modified AGI exceeds $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). The excluded part of a home sale gain doesn't count as investment income. Your state may tax the gain under its own rules, so check with your state tax agency.
If you claimed depreciation for a home office or rental use after May 6, 1997, you can't exclude the part of the gain equal to that depreciation, and it can be taxed at up to 25%. Our home office deduction guide explains the simplified method, which avoids this. Periods after 2008 when the home wasn't your main home, such as years as a rental before you moved in, can also shrink the exclusion. Publication 523 has worksheets for both.
Reporting the sale: Form 1099-S, Form 8949 and Schedule D
The closing agent usually files Form 1099-S, which reports the sale to the IRS. It can skip the form if you sign a written certification that the home was your main home, that the full gain is excludable, and that the price was $250,000 or less ($500,000 or less if you are married).
- If you received a Form 1099-S, report the sale on Form 8949 even if none of the gain is taxable.
- If part of the gain is taxable, report it on Form 8949 and Schedule D, as long-term or short-term depending on how long you owned the home.
- If you can exclude all the gain and got no Form 1099-S, you generally don't report the sale at all.
A large taxable gain may mean you need to make an estimated tax payment or raise your withholding; see our guide to quarterly estimated taxes. In the year of sale, if you itemize, you can deduct the real estate tax for the part of the year you owned the home.
Records, special cases and when to get help
Keep your closing statements and receipts for improvements until at least 3 years after the due date of the return for the year you sell. Our guide on how long to keep tax records explains why.
This guide doesn't cover second homes and rentals, which don't qualify; a separate building used for business; seller financing, where you report interest each year; or a foreclosure, where canceled mortgage debt can create income. Transferring the home to a spouse or ex-spouse in a divorce settlement generally means no gain or loss. Consider a tax professional if the home was ever rented out or held a depreciated home office, came to you by divorce or gift, or if you are using the military suspension or a partial exclusion.
Spotted something wrong or out of date? Report a correction and include this page’s address.
