are met with respect to property if such property has, as of the date of the sale or transfer referred to in paragraph (1), a legal restriction or agreement sufficient to obligate any owner to make (at all times during the 30-year period beginning on such date) such property either— (A) residential rental property (within the meaning of section 168) not less than 75 percent of the units of which are affordable to low-income families and either occupied by or available for use by low-income residents, or (B) a shelter eligible for assistance under title IV of the McKinney-Vento Homeless Assistance Act. (4) Special rule with respect to period within which property must be replaced In the case of a sale or transfer described in paragraph (1), subsection (a)(2)(B)(i) shall be applied by substituting 3 years for 2 years . (5) Special rule for real property held for productive use in trade or business For purposes of subsection (a), if the real property described in paragraph (1) is held for productive use in a trade or business or for investment, property of a like kind to be held either for productive use in a trade or business or for investment shall be treated as property similar or related in service or use to the property so described. . (b) Effective date The amendment made by this section shall apply to sales and transfers after the date of the enactment of this Act.