S-Corp owner in one state, revenues come from work performed in another
I am the sole owner of an S-Corp in one state X (where I live) and pay myself a salary from the corporation. The corporation bills clients for work I perform which is most often in another state Y.
I am pretty certain I need to pay state tax to State Y on my salary since the work is mostly performed in that state. But do I pay tax to State X or State Y on the income from the corporate profit distributions to me?
To summarize:
Live in State X, work for and own a corporation in State X.
Work for clients in State Y.
Pay state income tax on W2 salary to State Y?
Pay state income tax on unearned income from corporate profit distributions to State X?
Thanks!