Even if you can afford to buy a home it isn't necessarily economical accounting in the opportunity cost of capital. This ofc varies across different times and situations regarding interest rates, regulation on mortgages in your jurisdiction, house prices and rent prices.