A little over a year ago now, I purchased a condo in my hometown and planned on doing exactly as you just explained. Buy it as a primary, live there for a year, maybe 2 max, then rent out my unit and cashflow! Since living there, I learned a few things that I will share...
1. Try to notice how old is the condo community is. - My condo was built in the late 70s so the community is at the point where many things need to be replaced. The roof was re-done prior to me buying the place which I knew but being young and naive and didn't realize what else needed to be replaced. Balconies, stairs, concrete, retaining walls, etc. My condo community has enough reserves in place where it doesn't directly impact us in terms of a special assessment but my HOA dues have increased 2.9% for the last two years.
2. By-laws can change over time. My community is FHA approved and in order to maintain that status, you need less than 1/2 the community to not be rentals. Therefore my HOA is trying to restrict the amount of rentals we have. What happens if you are restricted and can't rent out your unit later down the line?
3. Living in close quarters and having someone live above you can cause damage to your unit. I have not personally experienced this but I have heard stories where leaks occurred in the unit above and trickled down to their unit causing issues the owners just couldn't avoid.
I'm not saying its a good or bad investment. All I'm saying is make sure you due diligence on EVERYTHING! Best of luck!