What Is the 2-Out-of-5-Year Rule?

Posted Jan 31, 2024


When selling your primary residence, taxes still matter — and they can get complicated. Your home is a capital asset and, therefore, subject to capital gains tax. If your home appreciates in value, you might have to pay taxes on profit. However, there are exceptions.

The 2-Out-of-5-Year Rule Explained

According to the Internal Revenue Service, if you have a capital gain from the sale of your primary residence, you may qualify to exclude up to $250,000 of that gain for individuals and up to $500,000 if you file a joint return. You must meet the ownership and use tests to be eligible for that exclusion.

The 2-out-of-five-year rule states that you must have owned and lived in your home for a minimum of two out of the last five years before the sale. However, these two years don’t have to be consecutive, and you don’t have to live there on the sale date. You can exclude this amount each time you sell your home, but you can only claim this exclusion once every two years. Also, the ownership and occupancy periods don’t have to coincide.

For example, you can live in your home for a year, rent it out for three years, and then move back in for a year before the sale. It will still qualify as a primary residence under IRS guidelines.

Exceptions to the 2-Out-of-5-Year Rule

A vacation or even a short-term absence still counts as time you lived at home, even if you rented it out while you were away. If you became physically or mentally unable to care for yourself and spent time in a facility, that time still counts towards your 2-year residence requirements. The facility must be licensed to care for people with the same condition.

If you lived in your home for fewer than 24 months, you might be able to exclude a portion of the gain. However, you must qualify for the exception due to an extraordinary circumstance. Here are exceptions to the eligibility test:

  • Separation or divorce
  • Death of spouse
  • The sale involved vacant land
  • You owned a remainder interest and sold that right
  • The previous home was destroyed or condemned
  • You were a service member at ownership
  • You acquired or relinquished the house in a 1031 like-kind exchange

If you don't meet the eligibility test, you may still qualify for a partial exclusion of gain due to the following:

  • A work-related move
  • A health-related move
  • Unforeseeable events such as death, destruction of the home, giving birth to two or more children from one pregnancy, or becoming eligible for unemployment benefits

A partial claim is calculated based on the time spent living in the residence and if you qualify under one of the special circumstances.

Here's how the exclusion can be calculated: Count the number of months spent living in the home and divide it by 24. Multiply that number by $250,000 or $500,000 if married. The remaining number is the amount of gain that you can potentially exclude from your taxable income.

The home sale exclusion can considerably lower your tax liability, but you must follow the 2-out-of-5-year rule to be eligible.

How the exclusion can save money for taxpayers

Congress created a capital gains tax deferral for homeowners in 1951, adding Section 112 to the IRC (later Section 1034). If the owner bought another primary residence within a specified time, they could defer recognizing the gain. This rule was complicated, though, and required taxpayers to track accumulated deferrals. In 1964, Congress created Section 121, which allowed one-time exclusions under certain circumstances. The limit was for a gain of $125,000 and was only available to taxpayers over 55 who had lived in the home for at least three of the preceding five years. Section 121 did not require the homeowner to purchase a replacement property.

In 1997, Congress repealed Section 1034 and improved Section 121 by removing the age limit and single-use provision. Also, the updated rules increased the exclusion limit to $250,000 for single filers and $500,000 for married couples filing jointly.

Now, taxpayers can use the exclusion more than once as long as they meet the requirements. However, even if the taxpayer has two eligible homes, they can only use the exclusion every two years. If the taxpayer owns two houses and has split their time equally between them over the last five years, both could qualify for the exclusion when sold. But the once every two years provision will prevent the taxpayer from selling both and claiming the exclusion. Instead, they must wait two years between sales.

This material is for general information and educational purposes only. Information is based on data gathered from what we believe are reliable sources. It is not guaranteed as to accuracy, does not purport to be complete and is not intended to be used as a primary basis for investment decisions. It should also not be construed as advice meeting the particular investment needs of any investor.

Hypothetical examples shown are for illustrative purposes only.

Realized does not provide tax or legal advice. This material is not a substitute for seeking the advice of a qualified professional for your individual situation.

Download The Guide To Capital Gains

The Investor's Cap Gains Guidebook
Download eBook


The Investor's Cap Gains Guidebook

Download The Guide To Capital Gains

Re-invest your capital gains. Defer or Eliminate Taxable Income.

By providing your email and phone number, you are opting to receive communications from Realized. If you receive a text message and choose to stop receiving further messages, reply STOP to immediately unsubscribe. Msg & Data rates may apply. To manage receiving emails from Realized visit the Manage Preferences link in any email received.