If you sell your main home for more than you paid, federal law lets you leave up to $250,000 of the gain out of your income, or up to $500,000 if you’re married and file jointly. Both figures are real. Each comes with conditions, and the one couples miss most often is that the $500,000 isn’t automatic.
This page covers the federal rule only. It’s general information, not tax or legal advice for your sale. Figures and links were checked on November 15, 2026; the IRS publication cited is the edition for 2025 returns.
The amounts, as the IRS states them
IRS Publication 523 says that if you qualify, “you may exclude the first $250,000 of gain from the sale of your home from your income and avoid paying taxes on it,” and that “the exclusion is increased to $500,000 for a married couple filing jointly.”
The rule behind it is section 121 of the Internal Revenue Code. Its cap reads: “The amount of gain excluded from gross income under subsection (a) with respect to any sale or exchange shall not exceed $250,000.” The higher amount for couples sits in a separate paragraph with its own conditions.
Two tests: owning it and living in it
Publication 523 takes them one at a time.
- Ownership. “If you owned the home for at least 24 months (2 years) out of the last 5 years leading up to the date of sale (date of the closing), you meet the ownership requirement.”
- Residence. “If you owned the home and used it as your residence for at least 24 months of the previous 5 years, you meet the residence requirement.”
The 24 months of residence don’t have to be one stretch. The publication says they “can fall anywhere within the 5-year period,” and that what’s required is a total of 24 months, or 730 days. The five years are counted back from the closing date, so that’s the date to work from.
Why $500,000 isn’t automatic for a married couple
Filing jointly is necessary, but section 121(b)(2)(A) splits the two tests between the spouses:
- “either spouse meets the ownership requirements”;
- “both spouses meet the use requirements”; and
- neither spouse is ineligible because of the limit in paragraph (3) of that subsection. Read that paragraph in the statute before relying on it.
One owner is enough. One resident isn’t. Publication 523 says the same thing in plainer words: “each spouse must meet the residence requirement individually for a married couple filing jointly to get the full exclusion.”
The gain depends on your basis
The exclusion applies to gain, not to the sale price. Publication 523’s formula is short: “Subtract the adjusted basis from the amount realized to get your gain or loss.” The amount realized is the selling price less selling expenses. The adjusted basis starts with what you paid and goes up with improvements.
Not all spending counts. “Improvements add to the value of your home, prolong its useful life, or adapt it to new uses,” and their cost is added to basis. Repairs and maintenance that keep the home in good condition aren’t; the publication’s examples include painting, fixing leaks and replacing broken hardware.
The arithmetic on an assumed sale
These numbers are made up to show the steps. They aren’t typical, and they leave out everything in the list at the end of this page.
| Step | Amount |
|---|---|
| Purchase price | $300,000 |
| Improvements over the years (new roof, added bathroom) | $40,000 |
| Adjusted basis | $340,000 |
| Selling price | $650,000 |
| Selling expenses | $39,000 |
| Amount realized | $611,000 |
| Gain | $271,000 |
| Gain left after a $250,000 exclusion | $21,000 |
| Gain left after a $500,000 exclusion | $0 |
Take the $40,000 of improvements out of the table and the single filer’s leftover gain is $61,000 instead of $21,000. That’s what the folder of old receipts is for.
Excluded doesn’t always mean unreported
A sale can be fully covered and still belong on your return. IRS Topic 701 says that if you receive Form 1099-S, Proceeds From Real Estate Transactions, “you must report the sale of the home even if the gain from the sale is excludable.” The same page points to Schedule D and Form 8949 for the reporting.
What trips people up
- Counting five years from the wrong date. It’s the five years ending on the date of sale.
- Assuming marriage doubles the cap. Both spouses have to meet the residence test.
- Calling a repair an improvement. A new roof and a patched roof land in different columns.
- Skipping the return because no tax is due, after a Form 1099-S was issued.
Questions to answer before closing
- How many months did you own the home in the five years before the expected closing date?
- How many of those months did you live in it, and if you’re married, how many did each spouse live there?
- Will you file jointly for the year of the sale?
- Which past projects were improvements, and do you have the records?
- Will a Form 1099-S be issued?
If the sale is tied to buying your next home, Buying Before You Sell covers how lenders count the home you haven’t sold yet.
What this page leaves out
- Partial exclusions and the situations that allow them.
- Tax rates, the tax owed on any remaining gain, and state income tax.
- Homes also used for business or as a rental.
- How often the exclusion can be used.
Sources
- Internal Revenue Service, Publication 523, Selling Your Home (for use in preparing 2025 returns)
- Internal Revenue Service, Topic no. 701, Sale of your home (page last reviewed or updated November 9, 2026)
- 26 U.S.C. § 121, Exclusion of gain from sale of principal residence, subsections (a), (b)(1) and (b)(2)(A), via the Legal Information Institute, Cornell Law School