Should I buy or should I rent?

In the short term, because of the costs associated with buying a home and home ownership, it is always better to rent. Always. But how long is “the short term”?
In the long term home ownership builds equity. Prices and values generally rise. How long will I have to live in a place before it makes more sense to have bought it?
Here’s a handy calculator from the New York Times, which measures the costs associated with both. You have to live somewhere.

https://www.nytimes.com/interactive/business/buy-rent-calculator.html