First, don't consider flipping houses unless you have at least some experience with construction and home repair.
Second, you should plan on living in the house for at least two years to avoid paying capital gains tax on the profit.
Third, don't overimprove the house. Buy a house in a desireable neighborhood and town that has some disadvantage that can be easily fixed. Don't put in pricey extras that don't attract buyers (ie.: don't add an in ground pool because you've always wanted one, don't put in marble floors unless that is what most comparable houses have). Stick with neutral colors and materials that bring/keep the house comparable with others in it's market.
When preparing to sell, declutter the house and CLEAN it, thoroughly.
Our story:
DH and I purchased our first house 6 years ago. We specifically looked for a 3+ bedroom/2+ bath (that's what sells best) house in the better county in the area into which we were moving. We lucked out and found a traditional colonial that was 20 years old with the original owners selling. This was their retirement home and they had gotten too old to care for the house. The house was FILLED with 50 years of clutter. The yard was overgrown. The color schemes in the house were terrible -- one bathroom was entirely blue (toilet and all) and another was entirely yellow, one bedroom was mint green and another was the exact color of Pepto-Bismol. But the roof didn't need to be replaced, there weren't any signs of water in the basement, and the heating system was only a few years old. Sold!
In just over two years, DH and I stripped wallpaper, painted, gutted and remodeled bathrooms and took out a wall that separated a small family room from a small livingroom. DH thinned the trees in the yard and we pulled up overgrown vines. We did hire a neighbor to help with some painting and hired HD to replace some carpet. Otherwise, DH and I did the work ourselves. We put $10,000 into materials and made 20% more than our purchase price when we sold the house after two years.
On our second house, DH and I bought a smaller house in an area of very large homes. The house had a 306 degree view (lake and mountain views). Since DH was busy with work, we hired a contractor to finish the two bedrooms and one bathroom in the partially unfinished walk-out basement. We knew that in that market (Salt Lake City -- large LDS population with many kids), we needed to have 5 bedrooms and 3 baths to sell well when we moved. When we sold after 2 years, we lost about 1% in a market that had gone down an average of 5% during our living there and sold the house in one week (not bad for a market where houses were averaging 6 months on the market).
In our current home, we looked in three small New England towns that had low crime (virtually nonexistant) and good schools. Due to the fact that the towns are considered withing commuting distance of NY, we had to pay through the nose for a fixer upper. The home we ended up buying was 34 years old and needed some TLC. To make matters worse, the former owner had started remodelling and obviously didn't know what he was doing. DH is 3/4 of the way through remodelling one upstairs bathroom, we have had BIL come in and excavate/landscape the yard so that there is someplace for the kids to play (it was completely wooded) and we have had oil heat and central A/C installed. Our house is currently worth 15-20% more than we paid for it. In the nearish future, we will replace all doors on the house, finish/remodel a proper entryway, take down part of a wall or two, paint the interior and either replace the siding with stone or brick facade or repaint the exterior.
Some hints: We never take out loans to pay for any work we do/have done. If we can't pay for it, we don't do it.
Except for purchasing the first house, we've never paid closing costs or moving expenses. We buy houses we would be happy to live in for many years to come and we only move when DH needs to for work and then we make sure that work will cover our moving expenses. (I know a lot of people who move every few years and pay 6% real estate commissions and 4-5% in closing costs, not to mention $$$ for moving. That really eats into any profit you make.)
It is far easier to fix up a house before you have kids. We have two young children and our work is going much more slowly on this house than on our first house.
I hope this helps!
Edited to add: We have also learned to not get 30 year fixed mortgages. At least for us, a 7/1 ARM is the cheaper choice. We've moved across the country 3 times in 6 years. For us, 7 years IS long term.