How to file a joint return when we live in different states, but work in the same state?

 

       My spouse and I live in different states and will be filing a joint return.  What I understand is that we can file a joint return while living in different states, however I am unsure how to file our state return jointly. To add even more complication to our situation my spouse works in a different state. My spouse lives in Pa and works in NY, while I live in NY as well work in NY.  I know NYS will not except the state return if there is any discrepancies with the return.