Many of the rules inherent to the military are not entirely intuitive. For instance, military members do not acquire the residence of the state in which they are stationed. Service members, after completing boot camp, are assigned to a particular base. But when service members arrive at that base, even if it is in a new state, they do not acquire a new residence.
Courts cannot hear a divorce matter unless it has jurisdiction over the issue and the parties. For most divorce issues, the court acquires jurisdiction by the people living there. But, military members do not acquire domicile (new residence) from their duty station.
Military members retain the residence of their home state (or whichever state they designate as their home state). That means military members may have to file for divorce in a state that is hundreds of miles away from their duty station.
If you are unsure of your legal residence, it is where you file your state tax return (if you are required to file one).
If you are contemplating divorcing from your spouse, then you should speak to an experienced lawyer. An experienced attorney can go over your situation and guide you to through the various divorce legal issues. There is a myriad of special rules that can trip up a service member, including risking a dismissal of your case for lack of jurisdiction. A lawyer can go through the process with you to ensure that your divorce proceeds smoothly. Your case is something you may not want to go through alone.