Key points
- Up to $250,000 of gain on a main home, or $500,000 for most married couples filing jointly, can be excluded if the ownership and use tests are met: generally two of the last five years.
- Massachusetts taxes long-term capital gains at 5%. An additional 4% surtax applies to income above an annually adjusted threshold of just over $1 million.
- Depreciation claimed on a rental is generally taxed when you sell, even if part of the gain is excluded.
- When the seller is a foreign person, the buyer must generally withhold 15% of the amount realized under FIRPTA, with limited exceptions.
The home-sale exclusion
Under Section 121 of the Internal Revenue Code, you can exclude up to $250,000 of gain, or $500,000 for most married couples filing jointly, if you owned the home and used it as your main home for at least two of the five years before the sale, and you have not used the exclusion in the previous two years.
If you fall short because of a change of workplace, health or certain unforeseen circumstances, a partial exclusion may be available. Periods when the home was not your main home, such as years it was rented out, can reduce the exclusion. IRS Publication 523 sets out the tests and worksheets.
Federal and Massachusetts capital gains
Gain above the exclusion is taxed. Federally, long-term gains are taxed at 0%, 15% or 20% depending on income, and higher-income sellers may also owe the 3.8% net investment income tax on the taxable part.
Massachusetts taxes long-term capital gains at 5% and short-term gains, on assets held one year or less, at 8.5%. Since 2023 the state also applies a 4% surtax to taxable income above a threshold adjusted each year, which a large gain can push a seller over.
Gain is measured from your adjusted basis: what you paid, plus certain purchase costs and the cost of capital improvements. Records of improvements made years ago can reduce the tax materially.
Former rentals and investment property
Depreciation you claimed, or could have claimed, while a property was rented is generally taxed on sale at federal rates up to 25%, and it is not covered by the home-sale exclusion.
For investment or business property, a like-kind exchange under Section 1031 can defer gain under strict deadlines: identify the replacement property within 45 days after transferring the property you sell, and acquire it by the earlier of 180 days or your tax-return due date, including extensions. A typical deferred exchange is set up with a qualified intermediary before the sale closes. A personal residence does not qualify.
Sellers who are foreign persons (FIRPTA)
When the seller is a foreign person for US tax purposes, the buyer is generally required to withhold 15% of the amount realized and send it to the IRS. No withholding is required if the price is $300,000 or less and the buyer, or a family member, has definite plans to live in the property for the required period; a reduced 10% rate applies to residence purchases up to $1,000,000.
The withheld amount is a credit against the seller’s US tax, not the tax itself. A seller can apply for a withholding certificate to reduce it, but the application takes time. Raise the question with your attorney and tax adviser when you list, not at closing.
Records to gather now
Your tax adviser will need these to estimate the result before you price the home.
- The closing statement from your purchase
- Receipts and permits for improvements, by year
- Depreciation schedules from any years the home was rented
- The dates you lived in the home, and for couples, each spouse’s dates
- Your tax residency status and, if relevant, any prior withholding certificate correspondence
General information, current as of the date shown. Tax results depend on your full circumstances; confirm them with a qualified tax adviser before you list.
Sources
- IRS Publication 523 · Selling Your Home
- IRS Topic 409 · Capital gains and losses
- IRS · FIRPTA withholding
- IRS · Exceptions from FIRPTA withholding
- 26 U.S.C. §1445(c)(4) · reduced 10% rate for residences up to $1,000,000
- Mass. DOR · Tax rates (capital gains and 4% surtax)
- IRS · Like-kind exchanges of real estate

