If you are the nonresident spouse of a service member stationed in Maine, you do not pay Maine income tax on wages you earn in Maine.
There is nothing to apply for in advance. Claim the exemption on Maine Schedule NR when you file, or ask your employer to stop Maine withholding.
Your marriage certificate, the service member’s orders assigning them to Maine, and proof that you and the service member are residents of the same state other than Maine.