First you have to remember that real estate is similar to the stock market (although I believe a much safer investment than stocks) – you cannot predict what the market will do. But you can try to buy the best house in the neighborhood – so that when it is time to sell, no matter what the market is, your home is most desirable!
Location, location, location! This is what is most important. Look for homes in good school districts that will be a desirable neighborhood. Avoid homes that back up to major roads and loud nuisances (shopping centers, railroad tracks, highways- just to name a few). Try to get homes that are on the interior of the neighborhood and located in cul de sacs.
You will also want to buy it for about 60% of its value. This helps cover the costs of repairs that will be needed, keeping utilities on while it is vacant, fees for flipping the house, commissions to pay when selling it, among other fees that may come up. Depending on the condition of the home, you will have to adjust your margin based on the repairs you will need to do.