For my first house we decided we wanted to buy in about 5 years, so we took the price of the house we wanted plus 20% appreciation and figured out how much we would likely need to buy it when we got back from Europe.  Then I literally just divided that number by 60 and saved/invested every month.
I bought my first house with a VA loan because while searching I also found a great investment property I could fix up, so I used a VA loan and put 10% down on my house and 25% down on the investment property.
VA loans are a shitty deal however, unless you are a disabled vet and can waive the funding fee or don't mind paying a 3% fee for the privilege of being 100% leveraged.  The funding fee is a huge chunk of money that just goes down the drain because you decided not to save.  Everyone loves VA loans because they are easy, but it puts you into a situation where you have financed 100% of your home, put a ton of money into the closing anyway, all to get a rate normal banks can compete with anyway.
The last house I moved into I put 5% down on a conventional loan so that I could invest into a bottomed out Covid-stock-market, but I had more than 20% ready again.  I always forecast years out when I'll need the money, then save it.  I just moved to Utah in January for my job, and I'm already saving for a house in case I move again in 2024.
I like to keep my houses as rentals when I move out because I typically buy something good that needs work, then I fix it up nice and make it a rental when I leave.  Lots of work, lots of money and time to do this, but if you are willing to do the hard work it pays off.