Building equity maybe after the first several years of paying your mortgage. Don't forget to minus the additional costs you’ll be paying on your house for the rest of your life (repairs, renovations, insurance, taxes).
You have to consider the price-to-rent ratio where you're living, how long you'll be there, how much these above costs will be, rate that rent will increase, where you can invest and how much returns you can get on money that you're not spending on a mortgage, etc. For example, it's cheaper to in the Bay Area where I'm living to rent a home than it is to buy it. Go to a rent vs buy calculator and plug in the average home price vs home rental numbers for yourself.