There is some GREAT advice on here. I will reiterate.
1) Get pre-approved for a loan and shop for a house that is no more than 80% of what you are approved for. In other words, if the bank says your budget will allow you to get financed for $100K, then buy a house that cost no more than $80K.
2) 80% of the buyers sell their first house within 5-7 years. I sold my first house in year 7. With that being said, have an open mind about "Adjustable Rate Mortgages", such as 5/1 ARMS. If you are only going to be there for 7 years, it makes sense to pay a 5% rate for the first 5 years than to pay a 6.5% rate for the first five years.
3) Try to stay away from areas near things that would make it hard to sell your house. Graveyards, railroads, liquor stores, etc. Remember, 80% of the first time buyers want something better after 5-7 years, so you don't want to have a problem trying to sell a house near a railroad while you are building your DREAM HOME!
4) When you buy, make sure YOU WIN. Take the emotion out of the buying process. If you can buy from somebody who lost their job, going through a divorce, or got in over their heads, then more than likely you will get a good price on your house. Make sure the seller is the one that is DESPERATE, not you. (sounds mean, but its the truth and moreso the NORM).
** When I sold my first house, I sold it to a woman who was single with kids and had bad credit. I was already in the last stage of closing on my new house and was will to rent the previous house out for no-profit. However, since my buyer was credit challenge, single, kids, and desperate to get into a house, all I had to do was help with closing cost (a couple thousand dollars) and I was able to get top dollar for my property. Used that money to get into my new house without coming out of my pocket one red cent.