BATF uses a different definition of 'residency' for military gun-buying, quite different from the rest of the US Code (specifically, Title 50
) governing other aspects.
BATF Ruling 2001-5
is quite unambiguous:
Held further, a purchaser who is a member of the Armed Forces on
active duty is a resident of the State in which his or her permanent
duty station is located, and may satisfy the identification document
requirement by presenting his or her military identification card
along with official orders showing that his or her permanent duty
station is located within the State where the licensed premises are
I would suggest that, consistent with the other ruling already noted, you should be eligible to buy in either Maryland, your PCS assignment, or Virginia, where you are currently living and commuting from.
With a Texas license, showing a Texas address, you might be able to get away with
buying in Texas, unless the seller there somehow learned you were military and stationed outside Texas; BATF would likely be unsympathetic.
This is a bit of Federal law which deserves amendment; IMO, military already give up a lot (my father was active duty 27 years while I was growing up) and making some version of one's permanent home of record, perhaps where one claims residence for tax purposes, ALSO a place where the service member may legally purchase guns seems a very small bene with no cost whatsoever.