a. No rooming unit which was not classified and recorded as such in the department prior to May fifteenth, nineteen hundred fifty-four or converted to such use prior to April thirtieth, nineteen hundred fifty-six, shall be created in any dwelling, whether such conversion is effected with or without physical alterations, except for rooming units:
(1) Owned or controlled and operated by a hospital for occupancy by nurses and interns on its staff; or
(2) Owned and operated without profit by an educational, religious or charitable institution as a residence for the aged, or for working girls or women, or for working boys or men, or for delinquent, dependent or neglected children, or for students attending a school or college; or,
(3) approved by the commissioner of the department and created with the substantial assistance of loans, grants or subsidies from any federal, state or local agency or instrumentality; or
(4) approved by the commissioner of the department and owned, operated or used by any federal, state or local agency or instrumentality or by a non-profit organization.
b. When the ownership, operation or use by an institution or public agency for any of the purposes enumerated in subdivision a ceases, the certificate of occupancy shall expire.