If you are a legal resident of another state but are stationed in Maryland, your military income is not subject to Maryland income tax. However, you will be taxed as a nonresident on any portion of federal adjusted gross income that was derived from any real or personal property that is located in Maryland as well as non-military income earned in Maryland, including income from Maryland lottery prizes.
Military income only
If you are a nonresident with military income only, you do not have to file a Maryland income tax return.
Military income and other income outside Maryland
If you are a nonresident with military income only - or military income and other income earned outside of Maryland - you do not have to file a Maryland income tax return.
Military and other income earned in Maryland, single or with an unemployed civilian spouse
If you are a nonresident with military income and other income earned in Maryland, single, or have an unemployed spouse, you must file a nonresident Maryland Form 505, reporting total income and subtracting military pay. You must also file Form 505NR, subtracting unearned and non-Maryland income, then computing the Maryland taxable net income. In addition, you must adjust your exemptions and deductions. The State of Maryland does not tax the military pay, and does not use the military pay to increase the tax liability imposed on other income earned in Maryland.
Military income with or without other income earned in Maryland, and civilian spouse employed in Maryland
See Administrative Release 1 - Military Personnel and Civilian Spouses - Both Residents and Nonresidents of Maryland for guidance and application of the Military Spouses Residency Relief Act, amending the Servicemembers Civil Relief Act.
Both spouses in the military and not domiciled in Maryland and one or both have Maryland income
If you and your spouse are in the military and not domiciled in Maryland, and one or both have Maryland income, you must file a joint nonresident return. You must also adjust your exemptions and deductions.