August 2026·4 min read

How Long Do You Have to Live in a House Before Selling in Massachusetts? (2026)

The IRS 2-of-5-year rule determines your federal capital gains exclusion. Massachusetts adds a 12% short-term rate on property held under 1 year — the two rules together shape your optimal sale timing.

The 2-of-5-Year Rule (IRC §121)

Under IRS Section 121, you can exclude up to $250,000 of gain (single filer) or $500,000 (married filing jointly) from federal capital gains tax — provided you have used the home as your primary residence for at least 2 of the last 5 years ending on the sale date. The 2 years do not need to be consecutive.

Massachusetts follows the same rule for state capital gains purposes. The state rate on long-term capital gains is 5% flat. If you sell before meeting the 2-year threshold, the full gain becomes taxable — though pro-rated partial exclusions are available for qualifying hardships (job relocation 50+ miles, divorce, medical necessity).

Massachusetts Short-Term Capital Gains: 12%

Massachusetts imposes a 12% capital gains rateon property sold within 1 year of purchase — much higher than the standard 5% long-term rate. This applies to all property types, including primary residences that don't qualify for the §121 exclusion. If you're planning to sell shortly after buying, wait at least 1 year to drop from 12% to 5% on your Massachusetts tax bill.

Massachusetts Real Estate Transfer Tax

Sellers pay a real estate transfer tax (deed excise) of $4.56 per $1,000 of sale priceat closing, regardless of how long the home was owned. On a $400,000 sale, that's $1,824. Dukes County (Martha's Vineyard) adds a 2% land bank fee on the portion over $100.

Sale Timing Scenarios — Massachusetts

ScenarioFederal TaxMA State TaxTransfer TaxTiming Note
Lived there 2+ years of last 5 (primary residence)Up to $250K excluded (single) / $500K (married) — IRC §121Same exclusion applies to MA capital gains — 5% flat rate on taxable gain$4.56/$1,000 paid by seller at closingSell any time after 2-year mark
Lived there under 2 years — job relocation (50+ miles)Pro-rated exclusion allowed — partial exclusion based on time livedPro-rated exclusion applies; consult MA DOR guidance$4.56/$1,000 regardlessHardship exception — can sell before 2-year mark
Lived there under 2 years — divorceEach spouse may claim up to $250K if meeting requirementsSame federal treatment generally followed$4.56/$1,000 regardlessDivorce is qualifying hardship for partial exclusion
Investment property (never primary residence)No §121 exclusion — all gain taxable; §1031 exchange availableFull gain taxable at 5% (long-term) or 12% (under 1 year held)$4.56/$1,000 regardlessHold 1+ year for long-term rate
Sold before 1 year (any property type)Short-term capital gains — taxed as ordinary income (up to 37%)Massachusetts taxes short-term gains at 12% (property under 1 year)$4.56/$1,000 regardlessAvoid selling before 1 year if possible — highest tax rate
Need to Sell Your Massachusetts Home Fast?

Cash offer in 24 hours. Close in 7 days. We handle all conditions and timelines.

Call (401) 396-7427Get Cash Offer →

Frequently Asked Questions

How long do I have to live in my Massachusetts home before selling to avoid capital gains tax?

2 of the last 5 years as your primary residence (IRS §121). Excludes up to $250K (single) or $500K (married) from federal capital gains. Massachusetts follows the same rule at 5% state rate. Selling before 1 year held triggers MA's 12% short-term rate.

What is the Massachusetts real estate transfer tax?

$4.56 per $1,000 of sale price, paid by the seller at closing — regardless of how long you owned the home. Dukes County adds a 2% land bank fee on the portion over $100.

Tax note: This guide is for informational purposes only and does not constitute tax advice. Capital gains rules have many exceptions and interact with your total income. Consult a CPA or tax professional before making decisions based on capital gains timing.

Related MA Guides

Capital Gains Tax MASelling House MA GuideGet Cash Offer MAHow Long to Sell MA