Idhala, welcome to the forum. version2.0 genelized your question quite well. Every position in the military has a training time period before you get to your first Fleet command. Since I think you are directing your question towards aviation, it takes anywhere from 1.5-3 years to get completely through the training pipeline before you check into your first Fleet Squadron. During that time frame, you have your training classes, flights, and other requirements to attend to, and depending on the route you take, you may move from place to place as you go from one phase of training to another. But you will be home every night.
When you finally make it to your first Fleet Squadron, depending on where they are, you might join them on deployment, or when they are on homecycle. Depending on the community you have different rotations, 24 month cycles or 18 month cycles. IE, you deploy for 6 months, and then are home for a year or a year and half to complete that cycle, then you begin again. Also, deployments, especially in todays world, can extend past that 6 months, some of the carriers have deployed up to 9 months lately. While on homecycle, you go to work as normal, train, and prepare for the next deployment. In some cases you will det to other locations to train for a couple weeks. All of this is speaking in general terms, since each community is different, but it give you a general idea. The first sea tour lasts 3 years, and that would give you possibly 2 sea tours, so, gone 1 year of the 3 years. After the first sea tour, you have a shore tour lasting anywhere from 24-36 months, once again, community specific, and where you end up going. On a shore tour, you are on NOT the "hook" to deploy, depending on your job of course.
Hopefully that shed some light on your question.