related to such dwelling units located on the site of such dwelling units. For purposes of clause (i), each townhouse or rowhouse shall be treated as a separate building. (B) Exception for certain properties Such term shall not include any residential rental property (as so defined)— (i) with respect to which a credit is allowed under section 42 for such taxable year or any property, or (ii) which— (I) was constructed by the taxpayer, or (II) acquired by the taxpayer after its construction but before the first date on which any dwelling unit in such property was occupied by a resident. (5) Regulations The Secretary shall prescribe such regulations as may be necessary or appropriate to carry out the purposes of this subsection, including regulations to prevent the avoidance of the purposes of this subsection. . (b) Application to capitalized amounts (1) In general Section 263A(f)(2) of the Internal Revenue Code of 1986 is amended by adding at the end the following new subparagraph: (D) Exception for certain interest of disqualified single family property owners Subparagraph (A) shall not apply to any interest for which a deduction would be disallowed under section 163(n). . (2) Carrying charges Section 266 of such Code is amended— (A) by striking No deduction and inserting the following: (a) In general No deduction , and (B) by adding at the end the following new subsection: (b) Special rule for certain interest of disqualified single family property owners No election may be made under this section to treat as chargeable to capital account any interest for which a deduction would be disallowed under section 163(n). . (c) Effective date The amendments made by this section shall apply to indebtedness incurred in taxable years beginning after the date of the enactment of this Act. 3. Disallowance of depreciation in connection with property used by disqualified single family property owners (a) In general Section 167 of the Internal Revenue Code of 1986 is amended by redesignating subsection (i) as subsection (j)