Selling Your Home While in the Military: The Exclusion and the 10-Year Suspension
Selling a main home can produce a large capital gain, and many sellers can exclude up to $250,000 of it, or $500,000 on a joint return. Military orders can break the usual two-out-of-five-year pattern, so the tax code lets members of the uniformed services suspend the five-year test period during qualified official extended duty. This guide covers what IRS Publication 523 says about the exclusion, the suspension election, its limits, partial exclusions, and reporting.
The basic exclusion
Publication 523 explains that a seller may exclude gain on the sale of a main home, up to $250,000, or $500,000 if married filing jointly. A partial exclusion, an amount smaller than the full figure, is available in the situations listed later in this guide.
The exclusion applies only to a principal residence. An individual has only one main home at a time; when a person has more than one, a facts and circumstances test decides, and the most important factor is where the person spends the most time. A house, condominium, cooperative apartment, mobile home, or houseboat can each qualify.
The ownership and use tests
The publication sets out an Eligibility Test. Step 1 lists automatic disqualifications: a home acquired in a section 1031 like-kind exchange during the past 5 years, and a seller subject to expatriate tax. Step 2 is ownership: at least 24 months (2 years) out of the last 5 years before the sale. On a joint return, only one spouse has to meet it.
Step 3 is residence: the seller must have used the home as a residence for at least 24 months (730 days) of the previous 5 years. The months can fall anywhere in the period and need not be consecutive. On a joint return, each spouse must meet the residence requirement individually for the full exclusion. A vacation or other short absence counts as time lived at home, even if the home was rented out meanwhile.
Step 4 is the look-back: the exclusion may be taken only once during a 2-year period. Step 5 lists situations that can change the result, and one of them applies to a seller who was a service member during the ownership of the home: the election described next.
Suspending the five-year period for military duty
A seller or spouse who is a member of the Uniformed Services or the Foreign Service, an employee of the intelligence community, or a Peace Corps employee, enrolled volunteer or volunteer leader serving outside the United States may choose to suspend the 5-year test period for ownership and residence during qualified official extended duty. A seller may then meet the 2-year residence test even though, because of service, the seller did not live in the home for 2 years during the 5 years before the sale.
The election is made by filing the return for the year of the sale and excluding the gain. It can be revoked at any time, and the 5-year period cannot be suspended for more than one property at a time.
What counts as qualified extended duty
A person is on qualified extended duty when all three of the following are true.
- The person is called or ordered to active duty for an indefinite period, or for a definite period of more than 90 days. Drill weekends and short training periods do not meet the more-than-90-day test; the orders must be for more than 90 days or indefinite.
- The person is serving at a duty station at least 50 miles from the main home, or is living in government quarters under government orders.
- The person belongs to a listed group, which includes the Army, Navy, Air Force, Marine Corps, Space Force and Coast Guard, and the commissioned corps of NOAA and the Public Health Service.
The 10-year limit and the 15-year ceiling
The suspension period cannot last more than 10 years. Together, the 10-year suspension and the 5-year test period can be as long as, but no more than, 15 years. Publication 523 gives two examples.
In the first example, a home bought on May 1, 2008 was used as a main home until August 27, 2011, then the owner went on qualified official extended duty with the Navy and sold on August 1, 2024. With the full 10-year suspension, the 5-year test period reaches back to August 2, 2009, and the owner lived in the home more than 24 months of it, so the tests are met.
In the second, a home bought in 2016 was used as a main home for 3½ years, followed by 6 years of qualified official extended duty with the Army and a sale in 2025. Disregarding the 6 years, the test period is the 5 years before the duty began, and the owner lived in the home 3½ years of it, so the tests are met.
Nonqualified use and the military exception
Gain is not excludable to the extent it is allocable to nonqualified use, meaning any period after 2008 when neither the seller nor the spouse (or former spouse) used the home as a main home. Exceptions include up to 10 years of qualified official extended duty, any part of the 5-year period after the last date the home was used as a main home, and temporary absences totaling no more than 2 years for a change of employment, health, or other unforeseen circumstances.
Reduced exclusion
A seller who does not qualify for the maximum may still qualify for a reduced exclusion. The publication's worksheet uses these steps.
- Find the shortest of three periods: residence in the home during the 5 years before the sale, ownership, and time since the last sale with an exclusion, if any.
- Divide that period by 730 if counting in days, or by 24 if counting in months.
- Multiply the result by $250,000. For a joint return, repeat for the spouse and add the two results.
Only gain above the resulting limit is taxable, unless some gain comes from business or rental use.
When a partial exclusion is available
A seller who fails the eligibility test may still qualify for a partial exclusion when the main reason for the sale was a change in workplace location, a health issue, or an unforeseeable event. Publication 523 lists these situations.
- Work-related move: the seller, spouse, co-owner, or anyone else using the home as a residence took or was transferred to a new job at least 50 miles farther from the home than the old work location, or began a first job at least 50 miles from the home.
- Health-related move: a move to obtain, provide, or facilitate treatment of a disease, illness, or injury for the seller or a family member, or on a doctor's recommendation because of a health problem.
- Unforeseeable events: the home was destroyed, condemned, or suffered a casualty loss; or a death, divorce or legal separation, multiple births from one pregnancy, unemployment compensation eligibility, or inability to pay basic living expenses after a change in employment status; or an event the IRS names in published guidance.
- Other facts and circumstances: a seller may qualify by showing the primary reason for the sale was work related, health related, or unforeseeable.
Sorting the cases
| Situation | What Publication 523 says |
|---|---|
| Single or married filing separately, tests met | Maximum exclusion of $250,000. |
| Married filing jointly, both spouses meet residence and look-back, one or both meet ownership | Maximum exclusion of $500,000. |
| Residence test short only because of qualified official extended duty | Election to suspend the 5-year period, up to 10 years, made on the return for the sale year. |
| Maximum not available, but the sale was driven by a work move 50 or more miles farther, a health reason, or an unforeseeable event | Reduced exclusion: the 730-day or 24-month fraction times $250,000. |
| Rental or business use after May 6, 1997 | Gain equal to depreciation allowed or allowable is not excludable. |
Reporting the sale
If a Form 1099-S, Proceeds From Real Estate Transactions, was issued, the date of sale appears in box 1 and gross proceeds in box 2; if box 4 is checked, add the value of the noncash payments to box 2. Without a Form 1099-S, the date of sale is the earlier of the date title transferred or the date the burdens and benefits of ownership shifted to the buyer.
Gain that cannot be excluded is generally reported on Form 8949, Sales and Other Dispositions of Capital Assets, and Schedule D (Form 1040), Capital Gains and Losses. A seller who received a Form 1099-S must report the sale on Form 8949 even if there is no taxable gain to report.
Depreciation recapture warning
Service members often rent out a home while on orders. Publication 523 says the exclusion does not cover gain equal to depreciation allowed or allowable for rental or business use after May 6, 1997, even when the ownership and use tests are met. Basis is reduced by depreciation that could have been deducted, even if none was claimed, and Form 4797 and Pub. 544 cover the recapture.
Worked example
The two examples below are hypothetical. The people, dates, and figures are invented and only illustrate how the rule works.
Example A (Sgt. Dana Reyes, single). Reyes bought a home on June 1, 2015 and lived in it until November 30, 2017, which is 30 months. Reyes was then ordered to active duty for an indefinite period, at a duty station far more than 50 miles from the home, and never moved back. The home was never rented or used for business, and no depreciation was claimed. The home was sold on September 15, 2025. Reyes suspends the 5-year period for the duty period only (about 7 years 9 months), not the full 10 years.
- Without the election, the 5-year period before the sale (September 16, 2020 to September 15, 2025) contains 0 months lived in the home, so the residence test fails.
- With the election, the suspended duty period from December 1, 2017 to September 15, 2025 is about 7 years and 9 months, under the 10-year maximum. With the 5-year test period the total is about 12 years and 9 months, under the 15-year ceiling. Counting back 5 years from the start of the duty period, as in Publication 523 Example 2, the test period covers December 1, 2012 to November 30, 2017, with 30 months owned and lived in, so both tests are met.
Gain:
- Selling price $385,000, selling expenses $23,100. Amount realized: $385,000 minus $23,100 = $361,900.
- Purchase price $210,000, plus $4,000 of closing costs and $16,000 of improvements: adjusted basis $230,000.
- Gain: $361,900 minus $230,000 = $131,900.
- Exclusion limit for a single seller: $250,000. Since $131,900 is below $250,000, the taxable gain is $0.
The years on orders fall inside the military exception to nonqualified use. This result assumes no rental or business use and no depreciation; with either, the depreciation portion would be taxable.
Example B (Cpl. Sam Ortiz, single), worksheet arithmetic only. Ortiz lived in a home for 18 months and owned it for 40 months, with no earlier excluded sale. Ortiz then took a new job at a location 65 miles from the home, where the old one was 15 miles away: a work-related move at least 50 miles farther. The move was the main reason for the sale, which is a listed reason for a partial exclusion. The shortest of the three periods is 18 months. 18 divided by 24 = 0.75. 0.75 times $250,000 = $187,500. With a gain of $200,000, the amount above the limit is $200,000 minus $187,500 = $12,500, reported as a capital gain.
Limits of this guide
- It covers federal income tax under Publication 523 only. State tax treatment of a home sale varies, and the federal statute does not set it; a state tax agency answers that question.
- It does not work through installment sales, like-kind exchanges, vacant land, or divorce and surviving-spouse rules.
- A real return depends on actual records, and the Publication 523 worksheets apply to real figures.
A short checklist
- List the months of ownership and residence in the 5 years before the sale, and the date of sale.
- Check the orders and the 50-mile or government quarters condition, then the 10-year and 15-year limits.
- Note any rental use or depreciation after May 6, 1997, and whether a Form 1099-S arrived.
Sources
Related guides
- PCS Moving Expenses for Service Members
- Taxable vs. tax-free military pay
- Records to keep
- Other tax breaks