How to enter W2 info when worked in two states

I lived in MA the entire 2018, and the first 6 months I worked in MA, but took a new job in NY, so the last 6 months I worked in NY but still lived in MA. 

 

The question I have is, when filling out NY taxes do I only enter the W2 that had NY taxes on it or do I combine both MA+NY W2 wages? Likewise, would when submitting MA taxes, would I only enter the W2 that paid MA taxes?

 

Thanks in advance.