What's my residency?

In 2021, I will have lived in Costa Rica for January/February, Mexico for March, California for April, New York for May-July, and Boston for August-December.  My apartment is in New York, and I will be permanently relocating to Boston in August.  What should I claim as my residency?  And does partial-year residency change my taxes at all considering the various tax rates in each of these places?