all of the use of such property was in a coal community zone business of the taxpayer. (B) Special rule for substantial improvements The requirements of clauses (i) and (ii) of subparagraph (A) shall be treated as satisfied with respect to— (i) property which is substantially improved by the taxpayer before January 1, 2023, and (ii) any land on which such property is located. The determination of whether a property is substantially improved shall be made under clause (ii) of section 1400B(b)(4)(B), except that December 31, 2017 shall be substituted for December 31, 1997 in such clause. (5) Coal community zone business For purposes of this section, the term coal community zone business means any entity or proprietorship which would be a qualified business entity or qualified proprietorship under section 1397C if references to coal community zones were substituted for references to empowerment zones. (c) Qualified Capital Gain For purposes of this section— (1) In general Except as otherwise provided in this subsection, the term qualified capital gain means any gain recognized on the sale or exchange of— (A) a capital asset, or (B) property used in the trade or business (as defined in section 1231(b)). (2) Gain before 2018 or after 2022 not qualified The term qualified capital gain shall not include any gain attributable to periods before January 1, 2018, or after December 31, 2022. (3) Certain rules to apply Rules similar to the rules of paragraphs (3), (4), and (5) of section 1400B(e) shall apply for purposes of this subsection. (d) Certain Rules To Apply For purposes of this section, rules similar to the rules of paragraphs (5), (6), and (7) of subsection (b), and subsections (f) and (g), of section 1400B shall apply