exclusion of lodging (1) In general The aggregate amount excluded from gross income of the taxpayer under subsections (a) and (d) with respect to lodging for any taxable year shall not exceed $50,000 (half such amount in the case of a married individual filing a separate return). (2) Limitation to 1 home Subsections (a) and (d) (separately and in combination) shall not apply with respect to more than 1 residence of the taxpayer at any given time. In the case of a joint return, the preceding sentence shall apply separately to each spouse for any period during which each spouse resides separate from the other spouse in a residence which is provided in connection with the employment of each spouse, respectively. (3) Limitation for highly compensated employees (A) Reduced for excess compensation In the case of an individual whose compensation for the taxable year exceeds the amount in effect under section 414(q)(1)(B)(i) for the calendar in which such taxable year begins, the $50,000 amount under paragraph (1) shall be reduced (but not below zero) by an amount equal to 50 percent of such excess. For purposes of the preceding sentence, the term compensation means wages (as defined in section 3121(a) (without regard to the contribution and benefit base limitation in section 3121(a)(1)). (B) Exclusion denied for 5-percent owners In the case of an individual who is a 5-percent owner (as defined in section 416(i)(1)(B)(i)) of the employer at any time during the taxable year, the amount under paragraph (1) shall be zero. . (b) Effective date The amendment made by this section shall apply to taxable years beginning after December 31, 2017. 1402. Exclusion of gain from sale of a principal residence (a) Requirement that residence be principal residence for 5 years during 8-year period Subsection (a) of section 121 is amended— (1) by striking 5-year period and inserting 8-year period , and (2) by striking 2 years and inserting 5 years . (b) Application to only 1 sale or exchange every 5 years Paragraph (3) of section 121(b)