Source: http://www.teamszucs.com/Selling+a+Principal+Residence+Formerly+Used+for+Investment+Purposes%3F
Timestamp: 2019-04-19 22:15:17+00:00

Document:
Internal Revenue Code ("IRC") §121 allows taxpayers selling a principal residence to exclude $250,000 of gain from taxation (or, $500,000 for married taxpayers, filing jointly) as long as they have lived in the residence for 2 out of the preceding 5 years.
Alternatively, for taxpayers selling investment/rental property, while they may not exclude gain from taxation, they can nonetheless defer payment of taxes by completing their disposition as an exchange under IRC §1031.
While the rules for excluding gain from taxation or deferring payment of taxation may seem fairly straightforward under the above code sections, they become more complicated if the property was used as both a principal residence and for investment/rental purposes.
Fortunately, in February of 2005, the IRS issued Revenue Procedure 2005-14 clarifying that taxpayers are entitled to take advantage of both the §121 capital gains exclusion and the §1031 capital gains deferral. However, Rev. Proc. 2005-14 only addresses situations wherein the property being sold is investment property formerly used as a principal residence; it does not address how to apply §121 to situations when the property being sold is a principal residence formerly used for investment purposes.
Now, pursuant to the Housing Assistance Tax Act of 2008, taxpayers selling a principal residence formerly used for investment purposes, have specific guidance on the application of §121. Specifically, IRC §121 has been amended, effective January 1, 2009. Again, the amendment only affects taxpayers who are selling a principal residence ("qualified use"), which they formerly used for investment ("non-qualified use"). The central point of the §121 amendment is that these taxpayers are not entitled to the full §121 exclusion because the prior investment use is considered "non-qualified" use and any gain allocated to the period of non-qualified use may not be excluded under §121.
The period of non-qualified use (period not used as a principal residence) must be divided by the total years of ownership to determine the amount of the gain that is not eligible for exclusion under §121.
Any period of non-qualified use before January 1, 2009 should not be included in the calculation. And, depreciation should also be excluded from the calculation and is simply taxed at the applicable recapture rate.
Sale of residence that was formerly investment property – the taxpayer is entitled to only a prorated portion of the $250,000/$500,000 exclusion.
Example 1: Taxpayer acquires an investment property, rents it for 3 years and then occupies it for 5 years as his principal residence (no use prior to 2009) before selling it and realizing $350,000 of gain of which $40,000 is from depreciation deductions.
Thus $116,250 is not eligible for exclusion and is taxed at the applicable capital gains rate. $40,000 of gain is from depreciation and is taxed at the applicable recapture rate. The remaining gain of $193,750 may be excluded from taxation under §121.
Example 2: Taxpayer acquires an investment property in 2007, rents it until 2010, and then occupies it for three years as his principal residence before selling it in 2013, realizing $400,000 of gain. The two years prior to January 1, 2009 are disregarded (but included for determining the five year period).
Thus, $66,640 is not eligible for exclusion and is taxed at the applicable capital gains rate. $250,000 of the remaining gain may be excluded under §121, with the balance of the gain, $83,360 taxed at the applicable capital gains rate. In sum, $250,000 is not taxed and $150,000 is taxed.
Taxpayers selling a principal residence after January 1, 2009, which was formerly used as an investment/rental property should consult with their tax or legal advisors regarding the application of the amendment to §121 to their particular situation.

References: §121
 §1031
 §121
 §1031
 §121
 §121
 §121
 §121
 §121
 §121
 §121
 §121
 §121
 §121