(i)Special rules for certain transfersFor purposes of determining under subparagraph (B)(ii) when a building was last placed in service, there shall not be taken into account any placement in service—(I)in connection with the acquisition of the building in a transaction in which the basis of the building in the hands of the person acquiring it is determined in whole or in part by reference to the adjusted basis of such building in the hands of the person from whom acquired,
(II)by a person whose basis in such building is determined under section 1014(a) (relating to property acquired from a decedent),
(III)by any governmental unit or
qualified nonprofit organization (as defined in subsection (h)(5)) if the requirements of subparagraph (B)(ii) are met with respect to the placement in service by such unit or organization and all the income from such property is exempt from Federal income taxation,
(IV)by any person who acquired such building by foreclosure (or by instrument in lieu of foreclosure) of any purchase-money security interest held by such person if the requirements of subparagraph (B)(ii) are met with respect to the placement in service by such person and such building is resold within 12 months after the date such building is placed in service by such person after such foreclosure, or
(V)of a single-family residence by any individual who owned and used such residence for no other purpose than as his principal residence.