dascpa
Level 11

Don't know if link was bad or they changed Code section but it's 121(5) as shown below.

(5)Exclusion of gain allocated to nonqualified use

(A)In general

Subsection (a) shall not apply to so much of the gain from the sale or exchange of property as is allocated to periods of nonqualified use.

(B)Gain allocated to periods of nonqualified useFor purposes of subparagraph (A), gain shall be allocated to periods of nonqualified use based on the ratio which—
(i)
the aggregate periods of nonqualified use during the period such property was owned by the taxpayer, bears to
(ii)
the period such property was owned by the taxpayer.
(C)Period of nonqualified useFor purposes of this paragraph—
(i)In general

The term “period of nonqualifed use" means any period (other than the portion of any period preceding January 1, 2009) during which the property is not used as the principal residence of the taxpayer or the taxpayer’s spouse or former spouse.

(ii)ExceptionsThe term “period of nonqualifed use" does not include—
(I)
any portion of the 5-year period described in subsection (a) which is after the last date that such property is used as the principal residence of the taxpayer or the taxpayer’s spouse,
(II)
any period (not to exceed an aggregate period of 10 years) during which the taxpayer or the taxpayer’s spouse is serving on qualified period of extended duty (as defined in subsection (d)(9)(C)) described in clause (i), (ii), or (iii) of subsection (d)(9)(A), and
(III)
any other period of temporary absence (not to exceed an aggregate period of 2 years) due to change of employment, health conditions, or such other unforeseen circumstances as may be specified by the Secretary.
0 Cheers