Interest and property taxes associated with mortgages are tax deductible. The money you spend on rent is not text deductible. If you are going to own your home for 1-2 years, then keep renting because owning a home comes with high upfront closing cost that will not be recovered in the two years.
Every time you are paying off the mortgage, you are increasing your own equity. When you rent, you are helping the landlord increase his wealth while you have no stake in the house or the apartment.
On average if you are paying $1000 a month in rent, you are spending $12,000 a year and have absolutely nothing to show for it afterward. That same $1000 spent paying off a mortgage can be deducted from your taxes, and adds value to your net worth while the government gives you an added bonus in tangible cash. How many more reasons do you need to start really thinking about owning a home?