What is the 2-out-of-5-year rule?

Home About Us Find a Realtor Browse Agents by Market Become a Member Realtor Talk Estate of the Day Market Reports

The 2-out-of-5-year rule is the ownership and use test for the § 121 main-home exclusion. During the five years ending on the sale date, you must have owned the home and used it as your principal residence for periods adding up to at least two years, or 24 months. Publication 523 and Topic no. 701 explain the details.

Updated November 19, 2026

The 2-out-of-5-year rule is the ownership and use test for the federal exclusion of gain on a principal residence under § 121. During the five-year period ending on the date of sale, you must have owned the home and used it as your main residence for periods that add up to at least two years, or 24 months. The two years do not have to be a single continuous stretch.

How the two tests work

IRS Topic no. 701 states that if you owned the home for at least 24 months out of the last five years ending on the sale date, you meet the ownership test. If you used it as a residence for at least 24 months of that same five-year period, you meet the use test. The ownership period and the use period can be different 24-month stretches, but both must fall inside the five years ending at closing. On a joint return seeking the $500,000 limitation, either spouse may meet ownership, but both spouses must generally meet the use test.

Lookback and other limits

Even if the 2-out-of-5 tests are met, you generally cannot use the exclusion if you already excluded gain on another home sold during the two years before this sale. Publication 523 describes reduced, or partial, exclusions in certain situations such as a change in health, employment, or unforeseen circumstances that force an earlier sale. Time the home was rented, or used as a second home, can create nonqualified-use issues that reduce the excluded gain. Those computations belong with a tax advisor and the worksheets in Publication 523.

Why the closing date matters

The five-year window and the two-year lookback are measured to the date of sale, not to the listing date. A seller who has not quite completed 24 months of use, or who is close to the two-year lookback after a prior sale, may need to set the listing and closing calendar with that math in view. This rule is about eligibility for a federal exclusion, not about the best month to list in a neighborhood. Keep occupancy records and a clear principal-residence file if the facts could be questioned.

Sources

  • IRS, Topic no. 701, Sale of your home
  • IRS Publication 523 (2025), Selling Your Home
  • 26 U.S.C. § 121, Exclusion of gain from sale of principal residence

Related: What Is Capital Gains Tax on a Primary Home? and How Is Capital Gains Taxed on a Second Home? and When Is the Best Time to Sell a Luxury Home? and What Is the Role of a Tax Advisor in Selling?.

This is general information from Haute Real Estate Network, not legal, tax or financial advice.

Frequently Asked Questions

Does the two years of residence have to be the last two years before sale?

No. The 24 months may fall anywhere in the five years ending on the sale date.

Can one spouse's use support a $500,000 exclusion on a joint return?

Generally no. Topic no. 701 says both spouses must meet the use test for that larger limitation, while either spouse may meet ownership.

What if I sell before I have two years of use?

A full exclusion generally is not available. Publication 523 describes partial exclusions in certain qualifying situations.

Haute Real Estate Network — 999 Brickell Ave #840, Miami, FL 33131. realestate@hauteleaders.com