Military homeowners

Husband and I want to buy a house but he plans to stay in the military for 20 years. He’s been in for 2 years already and we’ve been talking about possibly buying at our next duty station. It’s too expensive to do here and we have no interest in settling here ever. We even thought of buying a home in our home state but then I’d be living apart from him with the kids which we do not want. We also are a one income household for now so we cannot pay a mortgage and rent at the same time. So is it smart to buy a house while in the military? If you or your husband or wife have done it what do you do when you move to another duty station? Do you sell the house? Is it even worth buying a house for 3 years then selling? Is it even possible? I know I’m asking a lot of questions but I am genuinely curious how people do it. We have $20k for a down payment so our range would be $150,000-$175,000. We would be using the VA loan if approved.