How to change "legal residency" (domicile)
First, military personnel often may be better off not changing residency to the state in which they're stationed unless there are longer-range reasons for doing so, e.g., qualify for in-state tuition at some later point. They are exempt from property taxes and income taxes in the state in which they're stationed (but of course are liable for them to the state of legal residence (domicile). They can also use their home state's driver's license. Think of "legal residence" (or domicile) as state citizenship. Physical residence is wherever you happen to be living.
How to change: No big deal. All it takes is presence in the new state and intent to abandon the old state and become a resident of the new one. Establishing intent is where the problems usually arise. Both states will require that the intent be manifested through actions, usually called "significant contacts" in law. That's easy to do: get the new state's driver's license and vehicle tags; register to vote in the new state; pay income and property taxes to the new state; open a bank account in the new state; pay income and property taxes in up to the point of domicile change (this might, for some states, require you to file as a part-year resident in both states for the year of the change). There are no special forms to fill out, no notices to put in newspapers, etc.
Where LOTS of military people screw it up big time is saying that they "intended" to change domicile and trying to play both ends against the middle, i.e., not paying taxes to either state but then claiming in-state tuition where they think it's most attractive. Both states end up collecting, usually with **huge** interest and penalties.
Additional factoid: Legal residence and domicile are pretty interchangeable. "Home of record" is a bit of military jargon that is not synonymous with domicile (though it could be the same). HOR is where you entered the service from. Changing your legal residence doesn't change home of record. That's not a big deal because HOR is irrelevant as to the things that get impacted by legal residence.