The federal exclusion: $250,000 or $500,000
Under IRS Topic 701, you can exclude up to $250,000 of gain from the sale of your main home, or $500,000 if you file jointly with a spouse. You qualify if, in the 5 years before the sale, you passed two tests:
- Ownership test: you owned the home at least 24 months (2 years).
- Use test: you lived in it as your main home at least 24 months (2 years).
The two years do not need to be in a row, and they can fall at different times inside the 5-year window. In general you cannot use the exclusion if you excluded gain on another home sale in the 2 years before. For joint filers, both spouses must meet the use test and one must meet the ownership test (Publication 523).
The exclusion covers gain, not the sale price. A $900,000 sale can still be fully tax-free if your gain is under your limit. Gain equals your sale price, minus selling costs, minus your adjusted basis. See cost basis and reporting.
Partial exclusion
If you do not meet the 2-year tests, you may still get a reduced exclusion if the main reason for the sale was a change in workplace location, a health issue or an unforeseeable event. Publication 523 gives the formula: take the shortest of your time living there, your time owning it, or the time since your last excluded sale, divide by 24 months (or 730 days), and multiply by $250,000. A single owner who lived in the house 12 months gets 12/24 x $250,000 = $125,000.
Things that cut the exclusion
Rental or business use, especially after 2008 when the home was not your main home, can make part of the gain taxable. Depreciation you took (or were allowed) on a rental or home office is generally taxed. If this describes you, see a CPA before the sale. The sell or rent calculator compares the two choices. Inherited homes use a different starting value. See inherited house taxes and stepped-up basis.
Federal rates on gain above the exclusion (2026)
Gain on a home you owned more than a year is long-term. The long-term rate is 0%, 15% or 20% depending on your taxable income, with the gain stacked on top of your other income. These are the 2026 breakpoints in IRS Rev. Proc. 2025-32, section 3.03:
| Filing status | 0% up to | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly (and surviving spouse) | $98,900 | $613,700 | $613,700 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
| Head of household | $66,200 | $579,600 | $579,600 |
Short-term gain (a home owned one year or less) is taxed at ordinary income rates. The IRS capital gains page lists the same three long-term rates; the page we read still showed the 2025 breakpoints, so we took 2026 from the Revenue Procedure.
Net investment income tax (3.8%)
An extra 3.8% tax applies to the lesser of your net investment income or the amount your modified adjusted gross income is over $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately), per the IRS NIIT page. Taxable home-sale gain counts as net investment income. Gain you exclude under the exclusion does not add to the tax.
How Massachusetts taxes the gain
Massachusetts follows the federal exclusion. The state tax expenditure budget says Massachusetts conforms to the section 121 exclusion, so gain you exclude federally is generally excluded for Massachusetts as well.
For gain that is taxable, the Mass.gov tax rates page lists:
- Long-term capital gains: 5.00%.
- Short-term capital gains: 8.5%. M.G.L. c. 62 s.4 applies it to gain on assets held 1 year or less. Massachusetts uses the federal definitions of short- and long-term.
- 4% surtax on taxable income over a threshold that is adjusted for inflation: $1,000,000 in 2023, $1,053,750 in 2024, $1,083,150 in 2025 and $1,107,750 in 2026 (Mass.gov). Only the part over the threshold is taxed at the extra 4%.
The surtax counts taxable home-sale gain. Mass.gov says there is no exclusion from the surtax for gain on a personal residence that is otherwise taxable. Example: a seller with $1,300,000 of total Massachusetts taxable income in 2026 pays 4% x ($1,300,000 - $1,107,750) = $7,690 in surtax, on top of the regular 5%.
Worked examples
These are simplified illustrations with made-up numbers, not tax advice. They ignore deductions, credits and state exemptions. We took 2026 federal figures from the IRS and Massachusetts figures from Mass.gov. Use the capital gains calculator for your own numbers.
| A: gain above the limit | B: gain inside the limit | C: partial exclusion | |
|---|---|---|---|
| Who | Single owner, lived there 15 years | Married couple filing jointly, lived there 14 years | Single owner, lived there 12 months, moved for a new job |
| Sale price | $850,000 | $900,000 | $600,000 |
| Selling costs | $50,000 | $55,000 | $40,000 |
| Adjusted basis (purchase plus improvements) | $350,000 | $460,000 | $400,000 |
| Gain (price - costs - basis) | $450,000 | $385,000 | $160,000 |
| Exclusion | $250,000 | $500,000 (covers all of it) | $125,000 (12/24 x $250,000) |
| Taxable gain | $200,000 | $0 | $35,000 |
| Federal tax at 15% | $30,000 (assumes $80,000 of other income) | $0 | Depends on other income |
| NIIT 3.8% | $3,040 (MAGI $280,000: 3.8% x $80,000 over $200,000) | $0 | Likely $0 below $200,000 MAGI |
| Massachusetts 5% | $10,000 | $0 | $1,750 |
| Rough total | $43,040 | $0 | Federal plus $1,750 |
In example B you may still receive a Form 1099-S. A 1099-S does not mean you owe tax. See cost basis and home sale tax reporting.
Before you list: questions to ask your CPA
- Do I meet the 2-of-5-year tests on my closing date? Count the closing date, not the contract date.
- Did I ever rent the house, run a business from it, or take depreciation?
- What is my adjusted basis? Gather receipts for improvements. Repairs generally do not count.
- Would waiting a few months get me past the 2-year mark or past the 1-year long-term mark?
- Will this sale push my income over the 3.8% NIIT line or the Massachusetts surtax threshold?
If you inherited the house, your basis is usually its value at the date of death, which often leaves little or no gain. See inherited house taxes and stepped-up basis. You can also compare routes at the comparison tool.