Taxes · IRS Publication 523Selling a home before 2 years: the partial exclusion and the military suspension
The home sale exclusion normally requires owning and living in the home for 2 of the 5 years before the sale. IRS Publication 523 (2025) gives two ways around a shorter stay. Partial exclusion: if the main reason for the sale was a change in workplace, a health issue or an unforeseeable event, you may exclude part of the gain. A work-related move qualifies if you – or your spouse, a co-owner or anyone else who lived there – took or were transferred to a job at least 50 miles farther from the home than the old work location, or began a job at least 50 miles away with no previous work location. A health-related move qualifies if you moved to obtain or provide diagnosis or treatment, or care for a family member (parents, grandparents, children, grandchildren, siblings, in-laws, uncles, aunts, nephews and nieces), or a doctor recommended a change of residence. Unforeseeable events include the home being destroyed, condemned or damaged in a disaster; and death, divorce or legal separation, the birth of two or more children from one pregnancy, becoming eligible for unemployment compensation, or a change in employment leaving the household unable to pay basic living expenses – plus events the IRS designates in published guidance. Even outside those standard cases, the facts can show the sale was work-, health- or unforeseeable-event-related, for example when the situation arose while you lived there and you sold soon after. Military and other service: if you or your spouse are a member of the uniformed services or the Foreign Service, an intelligence community employee, or a Peace Corps employee or volunteer serving abroad, you may suspend the 5-year test period while on qualified official extended duty – ordered to duty for more than 90 days or indefinitely, at a station at least 50 miles from the home or in government quarters. The suspension can last up to 10 years (15 years in total with the 5-year period), applies to one property at a time, can be revoked, and is elected by filing your return for the year of the sale.
Partial exclusion – the main reason was…
Work
A new job at least 50 miles farther from the home than the old one.
Health
Treatment or care for you or a family member, or a doctor's recommendation.
Unforeseeable event
Disaster, condemnation, death, divorce, multiple births, unemployment, can't pay basic expenses.
Other facts
The situation arose while you lived there and you sold soon after.
Suspending the 5-year test
1. Who
Uniformed services, Foreign Service, intelligence community, Peace Corps abroad – you or your spouse.
2. Qualified duty
Over 90 days or indefinite; 50+ miles away or in government quarters.
3. How long
Up to 10 years; 15 years in total with the 5-year period.
4. How
Elect it on the return for the year of the sale; one property at a time.
What the TC can do
- When a seller is selling after a short stay because of a job, health or family event, suggest they talk to a tax professional before closing.
- Military sellers: mention the suspension rule – it can preserve the exclusion after years away.
- Send the final settlement statement after closing for their tax records.
Questions about selling before 2 years
Can I exclude gain if I sell my home before living there 2 years?
Possibly a partial exclusion, if the main reason was a work-related move of at least 50 miles, a health-related move or an unforeseeable event (IRS Publication 523).
How does the military home sale exclusion work?
Service members, Foreign Service and intelligence staff and Peace Corps workers abroad on qualified official extended duty can suspend the 5-year test period for up to 10 years, so years away don't count against them.
Does divorce qualify for a partial exclusion?
Yes. Divorce or legal separation is one of the listed unforeseeable events.
Related guides
ClosingCode keeps each deal's documents, including the final settlement statement, in one place you can export.
Start free trialSource: IRS Publication 523 (2025), Selling Your Home – Partial Exclusion and the suspension of the 5-year test period (irs.gov, downloaded October 26, 2026).
General information, not tax advice. A tax professional can apply these rules to your own sale. ClosingCode is software; it is not a tax preparer. This guide is not a substitute for the advice or services of an attorney.