It hard to answer that question without all the specifics, but the short answer is that it probably is not worth buying.
The longer answer is that you would need to add up all the costs of renting and compare those against the cost of buying. The costs of buying include the the monthly Principle & Interest, property taxes, Home Owner associate fees, maintenance costs and the cost to sale the condo (Sales commissions, Sales Tax....).
IMHO, If you are truly only staying a couple years, the hassles of buying a condo probably far outweigh any potential cost saving.