Short answer: The main 1031 exchange 2-year rule says that if you exchange property with a related party, both of you must hold your properties for 2 years or the deferred gain becomes taxable. The phrase can also mean the 24-month second-home safe harbor, the 2-out-of-5-year home sale test, or the 5-year rule for exchanged homes.
Reviewed by Jon Hilley. Last updated September 29, 2026.
The only 2-year rule written into Section 1031 itself is the related-party holding period, but the phrase gets used for four different rules, and several of them come up when you look at 1031 exchanges and your home. Knowing which one applies to you depends on who you traded with and what you plan to do with the property.
The good news is that none of them is a minimum holding period for an ordinary exchange. The tax code doesn't set one; what matters is that you intended to hold the property for investment or business use when you exchanged it.
Key rules
- Related-party 2-year rule: if you exchange with a related party, both of you must keep your properties for 2 years after the last transfer, or the deferred gain is triggered (IRC §1031(f)).
- 24-month safe harbor for dwelling units: a vacation or second home qualifies if owned 24 months, rented at fair rent 14+ days in each 12-month period, and personal use is limited (Rev. Proc. 2008-16).
- Home sale exclusion: to exclude up to $250,000 of gain ($500,000 married filing jointly), you must have owned and lived in the home 2 of the last 5 years (IRC §121).
- 5-year rule for exchanged homes: if you got the home in a 1031 exchange, you can't use the home sale exclusion if you sell within 5 years of acquiring it (IRC §121(d)(10)).
- No statutory minimum holding period: intent at the time of the exchange controls (IRC §1031(a)(1)).
Rule 1: the related-party 2-year holding period
If you swap properties with a parent, child, sibling, spouse or an entity you control by more than 50%, both sides must hold what they received for 2 years. If either disposes of it early, the gain you deferred becomes taxable in the year of that later sale. Exceptions include the death of either party, an involuntary conversion, or a transaction without a tax-avoidance purpose (IRC §1031(f)(2)).
Rule 2: the 24-month safe harbor for second homes
A vacation home or second home you also use personally is only eligible if it is really held for investment. Rev. Proc. 2008-16 gives a safe harbor: for relinquished property, own it 24 months before the exchange, rent it at fair rent for at least 14 days in each of the two 12-month periods, and keep personal use to the greater of 14 days or 10% of the days rented. The replacement property must meet the same test for the 24 months after the exchange.
Rules 3 and 4: moving into a property you got in an exchange
Some investors exchange into a rental, rent it for a while, then move in and later sell it as their home. That can work, but two rules limit it. You must own the home at least 5 years from the exchange before the home sale exclusion applies, and you must meet the 2-out-of-5-year ownership and use test.
Even then, gain allocated to rental periods after 2008 (nonqualified use) isn't excludable (IRC §121(b)(5)), and depreciation taken after May 6, 1997 is taxed rather than excluded (IRC §121(d)(6)).
What the IRS looks at instead of a holding period
Because intent controls, the IRS and courts look at the facts around the property: how long you held it, whether you rented it at fair rent, how often you buy and sell, whether you subdivided or developed it, and how you marketed it. Frequent quick sales and development activity point toward property held for sale, which doesn't qualify.
Keep the records that show investment use: leases, rent deposits and a log of any personal use. Renting to a family member below fair rent can count as personal use rather than investment use.
Example: renting, then moving in
- Replacement house acquired in a 1031 exchange: rented for 2 years
- Then used as your main home: 4 years
- Total ownership: 6 years (past the 5-year rule)
- Sale price, net of selling costs: $1,000,000
- Adjusted basis (low because of the deferred gain carried over): $380,000
- Total gain: $620,000
- Depreciation taken while rented (taxable): $20,000
- Nonqualified use gain, 2 of 6 years of the remaining $600,000 (taxable): $200,000
- Gain excluded under §121 (married filing jointly): $400,000
You met the 5-year rule and lived there 4 of the last 5 years, so the exclusion applies, but only to the $400,000 allocated to qualified use. The $20,000 of depreciation and $200,000 of nonqualified use gain are taxable. Assuming 25% on the depreciation ($5,000) and 15% on the $200,000 ($30,000), the federal tax is $35,000; net investment income tax and state tax are not included. Your CPA or tax attorney should run your actual dates, since the allocation depends on them.
Other questions investors ask
Can I sell my house after 2 years and not pay capital gains?
Usually yes, on up to $250,000 of gain ($500,000 married filing jointly), if you owned and lived in it as your main home for 2 of the last 5 years. A home you acquired in a 1031 exchange is different: you must also have owned it 5 years, and gain allocated to rental use after 2008 and past depreciation stay taxable.
How do you prove the 2-out-of-5-year rule?
Keep records showing the home was your main residence: the address on your tax returns, driver's license and voter registration, plus utility bills and mail. For a home you got in an exchange, also keep the exchange closing statement, since it starts the 5-year clock.
How do I avoid capital gains tax on a 1031 exchange?
A 1031 exchange defers the tax rather than eliminating it. You can keep deferring by exchanging again, and if you hold the property until death, your heirs generally receive a stepped-up basis and the deferred gain is never taxed (IRC §1014). See what happens when you sell a 1031 exchange property later.
Common mistakes
- Thinking "2 years" is required for every exchange. We hear this often. It isn't a statutory holding period, though many advisors suggest holding at least 1 to 2 years to show investment intent.
- Swapping with a relative who then sells. In an exchange with a related party, the 2-year rule binds both sides, so a family member who sells early can trigger your deferred gain.
- Moving in too soon. We see investors buy a replacement "for retirement" and move in within months. That undercuts the investment intent the exchange depended on.












