All articles 4 min read

Gain or Loss From Sale of Home: Military Taxes (2025 IRS Guide)

This guide covers “Gain or Loss From Sale of Home” within military taxes. The following material presents the IRS treatment of this topic, including the qualifications, exceptions, and examples in the source section. Read the rules alongside the facts of your own situation before deciding what to report, deduct, or document.

Adapted from Publication 3 (2025), Armed Forces' Tax Guide, published by the Internal Revenue Service. This guide retains the source edition’s years, amounts, deadlines, and examples. It is guidance for that edition, not a statement that the same figures apply to every tax year.

Gain or Loss From Sale of Home

You may not have to pay tax on all or part of the gain from the sale of your main home. Usually, your main home is the one you live in most of the time. It can be a:

  • House,

  • Houseboat,

  • Mobile home,

  • Cooperative apartment, or

  • Condominium.

How much can you exclude?

You can generally exclude up to $250,000 of gain ($500,000, in most cases, if married filing a joint return) realized on the sale or exchange of a main home in 2025. The exclusion is allowed each time you sell or exchange a main home, but generally not more than once every 2 years.

What must you do to be eligible for the exclusion?

You will be eligible for the exclusion if, during the 5-year period ending on the date of the sale, you:

  • Owned the home for at least 2 years (the ownership test), and

  • Lived in the home as your main home for at least 2 years (the use test).

It doesn’t have to be a single block of time.

What happens if I don't meet the ownership and use tests?

If you don't meet the ownership and use tests due to a move to a new permanent duty station, you can exclude gain, but the maximum amount of gain you can exclude will be reduced. See Pub. 523 for more details.

Five-year test period can be suspended for members of the Armed Forces.

You can choose to have the 5-year test period for ownership and use suspended during any period you or your spouse serves on qualified official extended duty as a member of the Armed Forces. This means that you may be able to meet the 2-year use test even if, because of your service, you didn't actually live in your home for the required 2 years during the 5-year period ending on the date of sale.

Example.

David bought and moved into a home in 2017. He lived in it as his main home for 2½ years. For the next 6 years, he didn't live in it because he was on qualified official extended duty with the Army. He then sold the home at a gain in 2025. To meet the use test, David chooses to suspend the 5-year test period for the 6 years he was on qualifying official extended duty. This means he can disregard those 6 years. Therefore, David's 5-year test period consists of the 5 years before he went on qualifying official extended duty. He meets the ownership and use tests because he owned and lived in the home for 2½ years during this test period.

Limits on period of suspension.

The period of suspension can't last more than 10 years. You can't suspend the 5-year period for more than one property at a time. You can revoke your choice to suspend the 5-year period at any time.

Qualified official extended duty.

You are on qualified official extended duty if you serve on extended duty either:

  • At a duty station at least 50 miles from your main home, or

  • While you live in government quarters under government orders.

You are on extended duty when you are called or ordered to active duty for a period of more than 90 days or for an indefinite period.

What if the property was used for rental or business?

You may still qualify for a reduced exclusion of the gain from the sale of a home that you have used as a rental property or for business. However, you must meet the ownership and use tests discussed in Pub. 523.

What if there were periods when I didn't use the property as my main home and wasn’t on qualified official extended duty?

If the sale of your main home results in a gain that is allocated to one or more periods of nonqualified use, you can't exclude that gain from your income.

Nonqualified use means any period after 2008 when neither you nor your spouse (or your former spouse) used the property as a main home, with certain exceptions. For example, a period of nonqualified use doesn't include any period (not to exceed a total of 10 years) during which you or your spouse is serving on qualified official extended duty, discussed above. You will be able to exclude the gain attributable to the period during which you or your spouse served on qualified official extended duty.

Are my losses deductible?

You can't deduct a loss from the sale of your main home.

More information.

For more information, see Pub. 523.

Using the guidance

Keep the documents that establish the dates, amounts, and circumstances described above. References to other chapters, forms, worksheets, or earlier and later sections refer to the linked IRS publication. Check the full publication and its updates before relying on a rule for a different tax year or a situation not addressed here.

Sources and further reading

The cited U.S. government text is in the public domain. Source accessed October 28, 2026. Fynoptic has organized this material for educational use and is independent of, and not endorsed by, the IRS.