You bought the house planning to stay for years. Then the layoff came, or the diagnosis, or the twins, or the storm. Eighteen months after closing, you are selling. And because home prices rose, there is a gain.
Most people know the home sale exclusion requires two years. Fewer know that the same section of the Code has a hardship rule built in. If the sale was caused by the right kind of life event, you can exclude a prorated part of the gain. For many people, that is the whole gain.
The basic exclusion
IRC Section 121(a) excludes gain on the sale of a home if, during the five years ending on the date of sale, you owned and used it as your principal residence for periods totaling two years or more. Section 121(b) caps the exclusion at $250,000, or $500,000 for certain married couples filing jointly.
If you fall short of two years, the full exclusion is not available. But Section 121(c) provides a reduced maximum exclusion for sales caused by a change in place of employment, health, or unforeseen circumstances. Treasury Regulation Section 1.121-3 explains how it works.
The test: what was the primary reason?
Under Section 1.121-3(b), the sale must be "by reason of a change in place of employment, health, or unforeseen circumstances." If one of the regulation's safe harbors applies, the sale is deemed to qualify. If not, it qualifies only if one of those reasons was the primary reason, based on all the facts and circumstances.
The regulation lists factors that may matter, including whether the sale and the event are close in time, whether the home's suitability as your residence materially changed, and whether your financial ability to maintain the property was materially impaired.
Change in place of employment
Section 1.121-3(c)(2) creates a distance safe harbor. The sale is deemed to be because of a change in place of employment if the change occurs while you own and use the home as your principal residence, and the new place of employment "is at least 50 miles farther from the residence sold or exchanged than was the former place of employment." If you had no former place of employment, the new job must be at least 50 miles from the home.
Employment includes starting with a new employer, continuing with the same employer at a new location, and starting or continuing self-employment. The rule can apply to you, your spouse, a co-owner or another qualified individual under the regulation.
Health
Section 1.121-3(d)(1) says a sale is by reason of health if the primary reason is to obtain, provide or facilitate the diagnosis, cure, mitigation or treatment of disease, illness or injury of a qualified individual, or to obtain or provide medical or personal care for a qualified individual suffering from a disease, illness or injury. A sale that is "merely beneficial to the general health or well-being of an individual" does not count.
The regulation's safe harbor in Section 1.121-3(d)(2) is simple: a sale is deemed to be by reason of health "if a physician... recommends a change of residence for reasons of health." Get that recommendation in writing before the sale. One of the regulation's examples describes a homeowner injured in an accident who sells and moves in with her daughter so the daughter can provide care. That qualifies.
Unforeseen circumstances
Section 1.121-3(e)(1) covers an event "that the taxpayer could not reasonably have anticipated before purchasing and occupying the residence." Preferring a different house, or a financial improvement, does not count. But the regulation lists specific events that are deemed unforeseen circumstances if they occur while you own and use the home as your principal residence:
- The involuntary conversion of the residence.
- Natural or man-made disasters or acts of war or terrorism resulting in a casualty to the residence, without regard to whether the loss is deductible.
- For a qualified individual: death.
- Cessation of employment that makes the qualified individual eligible for unemployment compensation.
- A change in employment or self-employment status that leaves the taxpayer unable to pay housing costs and reasonable basic living expenses for the household.
- Divorce or legal separation under a decree of divorce or separate maintenance.
- Multiple births resulting from the same pregnancy.
Read that list again with this site's topics in mind. A layoff that qualifies you for unemployment, a disaster that damages the home, a death in the household, or a job change that leaves you unable to afford the house: every one of them is on it.
How the partial exclusion is computed
Section 1.121-3(g) computes the reduced maximum exclusion by multiplying the $250,000 limit, or $500,000 for certain joint filers, by a fraction. The numerator is the shortest of the time you owned the home during the five years before the sale, the time you used it as your principal residence during those five years, or the time since a prior sale for which you excluded gain. It can be measured in days or months. The denominator is 730 days or 24 months.
The regulation's own example: a homeowner sells 12 months after buying because of a job change and may exclude up to $125,000, calculated as 12/24 times $250,000.
Notice what the fraction applies to. It reduces the maximum exclusion, not the gain. If you owned the home 12 months and your gain is $40,000, your reduced maximum is $125,000, so the entire $40,000 can be excluded.
Disaster sales and insurance
When a disaster destroys a home, Section 121(d)(5)(A) treats the destruction as a sale for purposes of the exclusion, and Section 1033 may postpone any gain beyond the exclusion if you replace the property. If insurance paid more than your basis, read insurance payouts after a disaster alongside this guide.
When no safe harbor fits
The safe harbors are not the only way in. If your situation is not on the list, the sale can still qualify if the primary reason was a change in place of employment, health or unforeseen circumstances, judged on all the facts. The factors in Section 1.121-3(b) are your roadmap: show that the event and the sale were close in time, that the house stopped being suitable for you, or that you could no longer afford to keep it. A sale driven by a preference for a different house or an improvement in finances does not qualify under the unforeseen circumstances rule.
Documentation to keep
- Closing statements for the purchase and the sale.
- Records of improvements, which increase basis and reduce gain.
- Proof of the triggering event: the job offer letter and addresses for the distance test, the physician's written recommendation, the unemployment determination, the disaster declaration, the divorce decree, or other records.
- A short timeline showing the event and the sale were close in time.
Related moves
Selling the home is usually one part of a bigger move. Moving costs themselves are generally not deductible, and employer relocation money is generally taxable. See moving expenses and taxes. And once you have a new address, tell the IRS. See changing your address with the IRS.
The bottom line
You do not always need two full years to exclude gain on your home. If the sale was caused by a change in place of employment, health or unforeseen circumstances, Section 121(c) allows a prorated exclusion, and the regulation's safe harbors cover many of the life events people actually face. Document the reason, compute the fraction, and remember it limits the exclusion, not the gain.
Life cut your plans short. The tax code can still meet you partway.
Frequently asked questions
Can I exclude gain if I sell my home before living there two years?
Possibly. IRC 121(c) allows a reduced maximum exclusion if the sale was by reason of a change in place of employment, health or unforeseen circumstances. Treas. Reg. 1.121-3 explains the rules and provides safe harbors for many common situations.
Does losing my job count as an unforeseen circumstance?
It can. Treas. Reg. 1.121-3(e)(2) lists cessation of employment that makes a qualified individual eligible for unemployment compensation, and a change in employment that leaves the household unable to pay housing costs and basic living expenses, as events deemed to be unforeseen circumstances.
How is the partial home sale exclusion calculated?
Multiply the $250,000 limit, or $500,000 for qualifying joint filers, by a fraction: the shortest of your ownership period, use period, or time since a prior excluded sale, over 24 months or 730 days. Selling after 12 months gives a reduced maximum of $125,000 for a single filer.
Does a doctor's recommendation help with the health exception?
Yes. Under Treas. Reg. 1.121-3(d)(2), a sale is deemed to be by reason of health if a physician recommends a change of residence for reasons of health. A sale that is merely beneficial to general well-being does not qualify, so get the recommendation in writing.
This guide is general information, not legal advice. Tax law changes and every case turns on its own facts.