Idk why you’re being downvoted. I can confirm- bought in the Upper East Side of NYC 5 years ago. Appreciation wouldn’t offset closing costs and fees when I wanted to sell last year.
This is all very general, and doesn't apply to every area equally, but it is a very rare situation where selling after less than five years makes sense on its own. Renting is a great option for people planning to move again in that time frame.