In a
四合院, the
正房 is the north-facing main building occupied by the head of the family;
厢房 (east and west wings) are for children and junior relatives. The second meaning —
正房 as legal wife (opposed to
偏房, concubine) — comes from the architectural metaphor of rank by room.