It's not fully about buying or renting either. Pricing effects both equally
I took a gig in Houston in 2011, knew it was a bubble going in, and rented. I probably paid $200 more per month to rent vs. buy. Apres la deluge in 2016, I was in great shape; it cost me roughly $12k as insurance against having to sell into a down market.