(i)The term “qualified residence” means— (I)the principal residence (within the meaning of section 121) of the taxpayer, and (II)1 other residence of the taxpayer which is selected by the taxpayer for purposes of this subsection for the taxable year and which is used by the taxpayer as a residence (within the meaning of). (ii)If a married couple does not file a joint return for the taxable year— (I)such couple shall be treated as 1 taxpayer for purposes of clause (i), and (II)each individual shall be entitled to take into account 1 residence unless both individuals consent in writing to 1 individual taking into account the principal residence and 1 other residence. (iii)For purposes of clause (i)(II), notwithstanding section 280A(d)(1), if the taxpayer does not rent a dwelling unit at any time during a taxable year, such unit may be treated as a residence for such taxable year. (B)Any indebtedness secured by stock held by the taxpayer as a tenant-stockholder (as defined in section 216) in a cooperative housing corporation (as so defined) shall be treated as secured by the house or apartment which the taxpayer is entitled to occupy as such a tenant-stockholder. If stock described in the preceding sentence may not be used to secure indebtedness, indebtedness shall be treated as so secured if the taxpayer establishes to the satisfaction of the Secretary that such indebtedness was incurred to acquire such stock. (C)Indebtedness shall not fail to be treated as secured by any property solely because, under any applicable State or local homestead or other debtor protection law in effect on, the security interest is ineffective or the enforceability of the security interest is restricted. (D)For purposes of determining whether any interest paid or accrued by an estate or trust is qualified residence interest, any residence held by such estate or trust shall be treated as a qualified residence of such estate or trust if such estate or trust establishes that such residence is a qualified residence of a beneficiary who has a present interest in such estate or trust or an interest in the residuary of such estate or trust.