Section 179(b)(6) is amended— (1) by striking 2018 and inserting 2024 (2018 in the case of the dollar amount in paragraph (5)(A)) , and (2) by striking ‘calendar year 2017 and inserting calendar year 2024 ( calendar year 2017 in the case of the dollar amount in paragraph (5)(A)) . (c) Effective date The amendments made by this section shall apply to property placed in service in taxable years beginning after December 31, 2023. 6. Establishment of special rules for capital gains invested in rural opportunity zones (a) In general Subchapter Z of chapter 1 is amended by adding at the end the following new section: 1400Z–3. Special rules for capital gains invested in rural opportunity zones (a) In general (1) Treatment of gains In the case of capital gain from the sale to, or exchange with, an unrelated person of any property held by the taxpayer, at the election of the taxpayer— (A) gross income for the taxable year shall not include so much of such gain as does not exceed the aggregate amount invested by the taxpayer in a qualified rural opportunity fund during the 180-day period beginning on the date of such sale or exchange, (B) the amount of gain excluded by subparagraph (A) shall be included in gross income as provided by subsection (b), and (C) subsection (c) shall apply. (2) Election No election may be made under paragraph (1)— (A) with respect to a sale or exchange if an election previously made with respect to such sale or exchange is in effect, or (B) with respect to any sale or exchange after December 31, 2032. (b) Deferral of gain invested in qualified rural opportunity zone property (1) Year of inclusion Gain to which subsection (a)(1)(B) applies shall be included in income in the taxable year which includes the earlier of— (A) the date on which such investment is sold or exchanged, or (B) December 31, 2032. (2) Amount includible (A) In general The amount of gain included in gross income under subsection (a)(1)(A) shall be the excess of— (i) the lesser of the amount of gain excluded under paragraph (1)