This is a pretty cool interactive chart from Trulia that helps provide some direction on whether it is better to rent vs. Buy in various areas of the U.S.
You can see that there are for key variables that drive the decision
Whether you itemize on your tax return
How many years you would stay in the home
Do you pay home owner association fees
In addition Ben Carlson had a good post outlining the pros and cons of a 30 year fixed mortgage. Below is a example how of a person made no money on their home but also realize it was a very short period of time that the person actually owned the home. This is why of the four variable I listed above, the hardest and trickiest one to answer is the third one on how long you plan to stay in a home. This to a large extent probably depend upon the type of career that you have.
Speaking from someone who has lived in 5 states and moved about 13 times over the past 17 years sometimes you just never know when and where the opportunities will take you.