necessary to carry out the purposes of this section for taxpayers with respect to whom a residence is a principal residence for only a portion of the taxable year. (3) Special rule for individuals residing in government-subsidized housing In the case of a principal residence— (A) the rent with respect to which is subsidized under a Federal, State, local, or tribal program, and (B) with respect to which the taxpayer elects the application of this paragraph, in lieu of the credit determined under subsection (a), there shall be allowed as a credit against the tax imposed by this subtitle for such taxable year an amount equal to 1/12 of the amount of rent paid by the taxpayer (and not subsidized under any such program) during the taxable year with respect to such residence. . (b) Clerical amendment The table of sections for subpart C of part IV of subchapter A of chapter 1 of the Internal Revenue Code of 1986 is amended by inserting after the item relating to section 36B the following new item: Sec. 36C. Rent paid for principal residence credit. . (c) Effective date The amendments made by this section shall apply with respect to taxable years beginning after December 31, 2017.