The pandemic has upended the country’s housing markets, and some cities and regions are better positioned to bounce back than others.