This subchapter does not prohibit a municipality from imposing a limit on the number of people who may occupy a dwelling unit based on health and safety standards contained in:
(1) a building code as adopted under Subchapter G, Chapter 214;
(2) a fire code;
(3) standards adopted by the Department of State Health Services; or
(4) local, state, or federal affordable housing program guidelines.