This verse uses humor to show that no house is big enough to accommodate two people who don’t get along. If the husband and wife are always quarreling, each one could say with equal justification to the other, “I would rather be living up on the roof than in this house with you.”
People in Bible times sometimes built booths, or temporary shelters, on the flat roofs of their houses to provide relief from the heat during the summertime. Those huts would be cold and uncomfortable during rainy weather and the winter months. But constant squabbling in the main part of the house would tempt the residents to turn a roof-top shelter into a permanent dwelling.
PROVERBS 21:9 – It is better to dwell in a corner of the housetop, than with a brawling woman [quarrelsome wife, NIV] in a wide house.