Determining date of residency change - MA to NYC

Hello, I'm having a pretty tough time determining the date of my state residency change. Would really appreciate the help with the following:

 

For background, I work for a company that is based in MA, and at the start of the year I was living in Boston. I was visiting a friend in NYC mid-March right before the COVID lockdowns started, and as a result I ended up staying in NYC and telecommuting (working remotely) from NYC, and set up temporary mail forwarding to NYC. Given that my lease in Boston was up at the end of July, I decided to stay in NYC full-time with my friend for the forseeable future, and to continue working remotely for the same company in MA. I went back up to Boston at the beginning of July and moved my things to my friend's place in NYC, and officially changed my address to NYC on a permanent basis in July. I have therefore been working remotely from NYC since March 2020, although my new apartment in NYC did not become my official permanent residence until July 2020. My company has only been deducting MA state income taxes.

 

Given the above, would the date of my residency change from MA to NYC be:
a) mid-March - given that I started working remotely in NYC for my company in MA

b) beginning of July - when I moved my things to the address I had been since mid-March

c) end of July - when my Boston lease ended

 

Thank you!