Military relationship

I’ve been with my boyfriend for 3 years and I’ve known him for so much longer than that. I’m leaving for basic training next month because I joined the military, army specially. Active duty. I was wondering how our relationship could possibly survive that. We have talked about marriage a lot of times but that’s not something I want to push on him just because I am leaving. However, if we do get married, how would that work as well? Would he just go with me on all my deployments? If he decided to stay in NY while we’re married and I’m deployed, that wouldn’t be a problem right? Like he isn’t forced to come with me? I need help understanding married life in the military.

- also wanted to add that my recruiter didn’t go in-depth with all of those details because he figured it wasn’t important since I wasn’t married.