1: This gets complicated because (at least in the US) most people don't leverage their investments at a 5:1 ratio, but do leverage their home value by that much.
In markets where people want to live. Owning a couple acres around the far-flung suburbs of Seattle or DC will net you some good money.
No one is buying housing in Gary, Indiana. Floods have annihilated many towns around the Mississippi River, and there is plenty of real estate in Detroit and New Orleans that sure as hell ain't gonna exceed the S&P 500 anytime soon.
As far as "markets where people want to live" goes: yes, in any market, you can outperform the average if you can predict the future better than other investors. Some of the places around the Mississippi River probably used to be considered good investments; now they aren't. If this whole full-time remote thing catches on, it's possible that the bay-area will drop in prices. It's also possible that only part-time remote catches on, and interviews resume in person so people want to stay in the Bay Area. Heck, it's unlikely, but possible, that Cupertino or Saratoga decides to rezone large swaths of the town for more density and the increase in supply drops prices.
This is a valid rule of thumb only because transaction costs are generally much higher when buying a home than when renting. Typically 6% of the cost is siphoned off by brokers (3% to each side) and the fees people pay to take out a mortgage loan are significant. Fees you pay to start a lease generally amount to only a small fraction of these.