under subparagraph (A) for any calendar year may only be allocated to buildings located in a nonmetropolitan area (as defined in section 42(d)(5)(B)(iv)(IV) which is designated by the Secretary of Housing and Urban Development as a difficult development area (as defined in section 42(d)(5)(B)(iii)). (8) Other definitions For purposes of this subsection— (A) Housing credit agency The term housing credit agency means any agency authorized to carry out this subsection. (B) Possessions treated as States The term State includes a possession of the United States. (i) Definitions and special rules For purposes of this section— (1) Middle-income unit (A) In general The term middle-income unit means any unit in a building if— (i) such unit is rent-restricted (as defined in subsection (g)(2)), and (ii) the individuals occupying such unit meet the income limitation applicable under subsection (g)(1) to the project of which such building is a part. (B) Exceptions (i) Exclusion of low-income units A unit shall not be treated as a middle-income unit if such unit is a low-income unit (as defined under section 42(i)(3)). (ii) Unit must be suitable for permanent occupancy (I) In general A unit shall not be treated as a middle-income unit unless the unit is suitable for occupancy and used other than on a transient basis. (II) Suitability for occupancy For purposes of subclause (I), the suitability of a unit for occupancy shall be determined under regulations prescribed by the Secretary taking into account local health, safety, and building codes. (III) Single-room occupancy units For purposes of subclause (I), a single-room occupancy unit shall not be treated as used on a transient basis merely because it is rented on a month-by-month basis. (C) Special rule for buildings having 4 or fewer units In the case of any building which has 4 or fewer residential rental units, no unit in such building shall be treated as a middle-income unit if the units in such building are owned by— (i) any individual who occupies a residential unit in