I am having the same question about renting vs buying right now. I have been renting since 2013. I owned most of the years from 1980 until then.
During our rental period, we did have the unfortunate experience of the landlord ending our lease about 7 months before we planned to move. Our yearly lease was up and he decided to sell. Finding another place to stay for under a year was a real problem. We found a place for 7 months but it was a major compromise. Like most problems like this, we came out of it alive.
Our experience selling our next to last house was a nightmare. That took about 12 months with each month lowering the price but not enough. I never did an analysis of the costs but I expect after new windows, fixing up the kitchen, and other costs, I did not make money after living there for about 10 years.
I have found most people do not really know the costs of their home. For example, they know their monthly payment but do not execute the analysis for a new roof, windows, plumber, lawn cutting and investment loss costs on a down payment, interest, etc. I think people on this forum are more aware than most.
The key question for me now will be length of time we will be staying in the new community. The amount of travel we will be doing which is far more worry free in a rental. It is a great feeling to just lock the door when we leave for 4 weeks and not really worry if the pipes freeze, the basement floods, etc. Not that we do not take care of the property like our own but the consequences are not the same.
Ultimately however, it will come down to finding a rental that works for us. We will avoid a property that might be sold. And it will need to be a property that meets our needs. I think the first choice will be a rental. If we can't find the right one, we will buy. At the end of the day, the property needs to be meet our lifestyle. Rentals can do that for their design and the worry-free aspect.