How is "Non-Maryland Income" calculated for part-year resident?

Every reply I've seen so far is not sufficiently accurate.

 

I lived in Maryland for a month and a half before moving.  I have two W2s - one for PA, where I moved, and one for MD.


Which of the following is my "non-maryland income" based off of: 

 

 

1.  the Maryland "State wages, tips, etc" (W2 Box 16) subtracted from:

  • Gross pay
  • W2 Box 1 (wages, tips, other comp)

Or

 

2. State wages, tips, etc for the non-Maryland state? (W2 Box 16)

 


I can't find any straight answers about what exactly is "non-maryland income", and most of the links to Maryland's tax website from Google are broken.  The instruction PDFs are also ridiculous complex and basically require filling out the entire 502 form, which I thought is what Turbotax is supposed to be helping me do.  The fact that TurboTax doesn't elaborate or calculate what goes into this field is pretty disappointing, considering they know the dates I lived in each state.

 

Any clarity or help would be greatly appreciated.  Thanks in advance.