How does divorce affect the tests?
Time counts in your favor. If your spouse or ex-spouse lives in the home as a main home under your divorce or separation paperwork, that counts as your use while you still own a piece of it. And if the home came to you from your spouse, the time they owned it counts toward your ownership.
Sources
My spouse died. Can I still claim the larger exclusion?
Yes, if you sell within 2 years of the date of death, haven't remarried, and the couple would have qualified for the joint amount just before the death. After that you get the single amount. You can also add your late spouse's time owning and living in the home to yours.
Sources
I'm in the military or Foreign Service. How does that change things?
You can choose to pause the 5-year clock while you or your spouse are on qualified extended duty, for up to 10 years. That lets you count time before you left. Qualifying duty is at a station at least 50 miles from home (or in government quarters) under orders of more than 90 days or indefinite. The same choice is open to intelligence community employees and Peace Corps workers.
Sources
My home was destroyed or condemned. How does that work?
It's treated like a sale. You can exclude gain as usual, and you may be able to postpone any extra gain if you reinvest in a new home. The time you owned and lived in the old home can count toward the new one.
Sources
I'm financing the buyer's purchase. What changes?
You may be able to spread the taxable gain over the payment years using the installment method. Pub. 523 warns that any depreciation recapture income is reported in the year of sale; for a home depreciated on a straight-line basis there is usually little or none, and the depreciation slice is generally counted first as payments come in. If the buyer defaults and you take the house back, special rules apply and a one-year resale window can matter.
Sources
What about a short sale, foreclosure or forgiven mortgage debt?
A foreclosure or short sale can produce gain, loss or income, so the same exclusion questions come up. Debt a lender forgives is usually income. The special exclusion for forgiven home-mortgage debt reached only debt forgiven before 2026 or under a written agreement made before 2026, and we found no extension in the Code. So debt forgiven in 2026 under a new arrangement may be taxable income, even if the home sale gain is excluded. Pub. 4681 walks through the other exceptions, such as insolvency.
Sources
Authority, strongest first
- Code I.R.C. § 108(a)(1)(E)
- Publication IRS Publication 523 (2025), Selling Your Home
Section 108(a)(1)(E) as it reads in the Code through P.L. 119-121 (October 9, 2026): qualified principal residence indebtedness discharged before January 1, 2026, or subject to an arrangement entered into and evidenced in writing before January 1, 2026. P.L. 119-21 did not extend it. Pub. 523 and Pub. 4681 describe the rule as of the 2025 editions. We did not read
section 108(h) or the Form 982 rules for ourselves.
I had a government-subsidized mortgage. Does the sale cost me extra?
It might. If your loan came from a tax-exempt mortgage bond or a mortgage credit (MCC) program, you may have to pay back part of the subsidy when you sell within 9 years, even if the whole gain is excluded. Form 8828 figures it.
Sources