It's possible, but there are so many variables that it is impossible to give you a definate answer. I will give you a couple of hints, though.
1. Buy low. Nobody can predict what is going to happen with the market in the next 2 year. Yes, some people try, many with very impressive credentials, but there are so many different opinions, who do you believe? The fact is, real estate will always go up in value over time. How much time is the big unknown right now. But if you buy low enough, you have a better chance of selling for a profit. And by low, I don't mean low-priced. I mean below current market value. Look at bank owned (REO) properties to find some great deals.
2. FInd homes that mainly need cosmetics. A coat of paint, new flooring, and a spruce up of the kitchen and baths will dramtically raise the value and lower market time. Don't buy a home that needs major renovations unless you can do most of the work yourself to keep the costs down.
3. Make sure the home is located in a desirable, fast-selling neighborhood. It doesn't matter how nice you make the place, if no one likes the neighborhood, they won't even want to see it, let alone buy it.
4. Concentrate on curb appeal. Make sure the outside of the house is immaculate. Spend some money on landscaping.
5. Enjoy the tax benefits in the meantime (assuming you are going to live there for the 2 years). Not only can you deduct the mortgage interest and some other expenses, when you sell you can make up to $250,000 profit and not pay any taxes on it! ($500,000 for couples). Please talk to your tax advisor for full details.
Good luck and I wish you much profit.