All articles 11 min read

Eligibility Step 5—Exceptions to the Eligibility Test: Home Sale Taxes (2025 IRS Guide)

This guide covers “Eligibility Step 5—Exceptions to the Eligibility Test” within home sale 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 523 (2025), Selling Your Home, 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.

Context for these rules

The tax code recognizes the importance of home ownership by allowing you to exclude gain when you sell your main home. To qualify for the maximum exclusion of gain ($250,000 or $500,000 if married filing jointly), you must meet the Eligibility Test, explained later. To qualify for a partial exclusion of gain, meaning an exclusion of gain less than the full amount, you must meet one of the situations listed in Does Your Home Qualify for a Partial Exclusion of Gain, explained later.

Before considering the Eligibility Test or whether your home qualifies for a partial exclusion, you should consider some preliminary items.

Eligibility Step 5—Exceptions to the Eligibility Test

There are some exceptions to the Eligibility Test. If any of the following situations apply to you, read on to see if they may affect your qualification. If none of these situations apply, skip to Step 6.

Separated or divorced taxpayers.

If you were separated or divorced prior to the sale of the home, you can treat the home as your residence if:

  • You are a sole or joint owner, and

  • Your spouse or former spouse is allowed to live in the home under a divorce or separation instrument and uses the home as his or her main home.

For property owned by a spouse or former spouse, the term “divorce or separation instrument” means:

  • (a). A decree of divorce or separate maintenance or a written instrument incident to such a decree;

  • (b). A written separation agreement; or

  • (c). A decree not described in (a) that requires a spouse to make payments for the support or maintenance of the other spouse.

If your home was transferred to you by a spouse or ex-spouse (whether in connection with a divorce or not), you can count any time when your spouse owned the home as time when you owned it. However, you must meet the residence requirement on your own. If you owned your home prior to your marriage and after your divorce or separation and your spouse or former spouse isn’t allowed to live in the home under a divorce or separation instrument, you can count any time that you owned the home, solely or jointly with your spouse, as time when you owned it. However, you must meet the residence requirement on your own.

Surviving spouses.

If you are a surviving spouse who doesn't meet the 2-year ownership and residence requirements on your own, consider the following rule. If you haven’t remarried at the time of the sale, then you may include any time when your late spouse owned and lived in the home, even if without you, to meet the ownership and residence requirements.

Also, you may be able to increase your exclusion amount from $250,000 to $500,000. You may take the higher exclusion if you meet all of the following conditions.

  1. You sell your home within 2 years of the death of your spouse.

  2. You haven’t remarried at the time of the sale.

  3. Neither you nor your late spouse took the exclusion on another home sold less than 2 years before the date of the current home sale.

  4. You meet the 2-year ownership and residence requirements (including your late spouse‘s times of ownership and residence, if applicable).

Service, Intelligence, and Peace Corps personnel.

If you or your spouse are a member of the Uniformed Services or the Foreign Service, an employee of the intelligence community of the United States, or an employee, enrolled volunteer or volunteer leader of the Peace Corps, you may choose to suspend the 5-year test period for ownership and residence when you’re on qualified official extended duty. This means you may be able to meet the 2-year residence test even if, because of your service, you didn’t actually live in your home for at least the 2 years during the 5-year period ending on the date of sale. Make the election by filing your tax return for the year of the sale or exchange of your main home, and exclude the gain from your taxable income.

Qualified extended duty.

You are on qualified extended duty if:

  • You are called or ordered to active duty for an indefinite period or for a definite period of more than 90 days.

  • You are serving at a duty station at least 50 miles from your main home, or you are living in government quarters under government orders.

  • You are one of the following:

    1. A member of the armed forces (Army, Navy, Air Force, Marine Corps, Space Force, Coast Guard);

    2. A member of the commissioned corps of the National Oceanic and Atmospheric Administration (NOAA) or the Public Health Service;

    3. A Foreign Service chief of mission, ambassador-at-large, or officer;

    4. A member of the Senior Foreign Service or the Foreign Service personnel;

    5. An employee, enrolled volunteer, or enrolled volunteer leader of the Peace Corps serving outside the United States; or

    6. An employee of the intelligence community, meaning:

      1. The Office of the Director of National Intelligence, the Central Intelligence Agency, the National Security Agency, the Defense Intelligence Agency, the National Geospatial-Intelligence Agency, or the National Reconnaissance Office;

      2. Any other office within the Department of Defense for the collection of specialized national intelligence through reconnaissance programs;

      3. Any of the intelligence elements of the Army, Navy, Air Force, Marine Corps, Federal Bureau of Investigation, Department of the Treasury, Department of Energy, and Coast Guard;

      4. The Bureau of Intelligence and Research of the Department of State; or

      5. Any of the elements of the Department of Homeland Security concerned with the analyses of foreign intelligence information.

Period of suspension.

The period of suspension can’t last more than 10 years. Together, the 10-year suspension period and the 5-year test period can be as long as, but no more than, 15 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.

Example 1.

You bought a home on May 1, 2008. You used it as your main home until August 27, 2011. On August 28, 2011, you went on qualified official extended duty with the Navy. You didn’t live in the house again before selling it on August 1, 2024. You choose to use the entire 10-year suspension period. Therefore, the suspension period would extend back from August 1, 2024, to August 2, 2014, and the 5-year test period would extend back to August 2, 2009. During that period, you owned the house all 5 years and lived in it as your main home from August 2, 2009, until August 28, 2011, a period of more than 24 months. You meet the ownership and use tests because you owned and lived in the home for at least 2 years during this test period.

Example 2.

You bought and moved into a home in 2016. You lived in it as your main home for 3½ years. For the next 6 years, you didn’t live in it because you were on qualified official extended duty with the Army. You then sold the home at a gain in 2025. To meet the use test, you choose to suspend the 5-year test period for the 6 years you were on qualified official extended duty. This means you can disregard those 6 years. Therefore, your 5-year test period consists of the 5 years before you went on qualified official extended duty. You meet the ownership and use tests because you owned and lived in the home for 3½ years during this test period.

Vacant land next to home.

You can include the sale of vacant land adjacent to the land on which your home sits as part of a sale of your home if ALL of the following are true.

  • You owned and used the vacant land as part of your home.

  • The sale of the vacant land and the sale of your home occurred within 2 years of each other.

  • Both sales either meet the Eligibility Test or qualify for partial tax benefits, as described earlier.

Also, if your sale of vacant land meets all these requirements, you must treat that sale and the sale of your home as a single transaction for tax purposes, meaning that you may apply the exclusion only once.

Note:

However, if you move your home from the land on which it stood (meaning you relocate the actual physical structure), then that land no longer counts as part of your home. For example, if you move a mobile home to a new lot and sell the old lot, then you can’t treat the sale of the old lot as the sale of your home.

Home destroyed or condemned—considerations for benefits.

If an earlier home of yours was destroyed or condemned, you may be able to count your time there toward the ownership and residence test.

If your home was destroyed, see Pub. 547, Casualties, Disasters, or Thefts. If your home was condemned, see Pub. 544, Sales and Other Disposition of Assets.

Remainder interest.

The sale of a remainder interest in your home is eligible for the exclusion only if both of the following conditions are met.

  • The buyer isn’t a “related party.” A related party can be a related person or a related corporation, trust, partnership, or other entity that you control or in which you have an interest.

  • You haven't previously sold an interest in the home for which you took the exclusion.

Like-kind/1031 exchange.

If you sold a home that you acquired in a like-kind exchange, then the following test applies.

You can’t claim the exclusion if:

  1. Either (a) or (b) applies:

    1. You acquired your home in a like-kind exchange (also known as a section 1031 exchange), or

    2. Your basis in your home is determined by reference to a previous owner’s basis, and that previous owner acquired the property in a like-kind exchange (for example, the owner acquired the home and then gave it to you); and

  2. You sold the home within 5 years of the date your home was acquired in the like-kind exchange.

A main home isn’t available for exchange because the exchange must be between like-kind real property held for productive use in a trade or business or for investment. Also, real property held primarily for sale isn’t eligible for deferral of gain under section 1031. For an exchange of rental property that was later converted to personal use as a main home, there is a 5-year holding period required under section 121(d)(10). A separate 2-year holding period is required for exchanges between related persons under section 1031(f). See Pub. 544.

If you convert your main home to a rental property (or use a portion of the living area for productive use in a trade or business as in Revenue Procedure 2005-14, examples 3–6), the exchange rules under section 1031 and exclusion of income rules under section 121 may both apply.

If the requirements of both sections 1031 and 121 are met, the section 121 exclusion is applied first to realized gain; section 1031 then applies, including any gain attributable to depreciation deductions. Any cash received in exchange for the rental property is taken into account only to the extent the cash exceeds the section 121 excluded gain on the rental property given up in the exchange. The period before the exchange that is after the last date the property was used as a main home isn’t considered nonqualified use for purposes of the proration rules of section 121. To figure basis of the property received in the exchange (replacement property), any gain excluded under section 121 is added to your basis of your replacement property, similar to the treatment of recognized gain. You can’t convert the replacement property to a main home immediately after the exchange per section 1031(a)(1), which requires that replacement property be held either for investment or for productive use in a trade or business. For more information about like-kind exchanges, see Pub. 544.

For additional information about the intersection of sections 121 and 1031, see Revenue Procedure 2005-14, 2005-7 I.R.B. 528, available at IRS.gov/irb/2005-07_IRB#RP-2005-14.

Note, however, that any period after 2008 during which the property isn’t used as a principal residence is, with certain exceptions, considered nonqualified use of that property for which gain allocable to such period may not be excluded, in accordance with section 121(b)(5). This includes property that is separate from the main property and not a part of the living area of the main home that isn’t used as a principal residence for a period after 2008. See section 121(b)(5)(C). See also Revenue Procedure 2005-14 for examples that illustrate how to allocate basis and gain realized in an exchange that is also eligible for section 121 exclusion, as well as details of depreciation recapture. See Form 8824 and its instructions for more details. For additional information, see Property Used Partly for Business or Rental and Business or Rental Use of Home, later.

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.