I live outside of NYC in NYS but I work in NYC. I am able to exclude income earned outside of NYC from my NYC tax return, right? can I get any credit from NYS?

I live outside of NYC in NYS but I work in NYC. My NYC tax filing is based on whole NYS income but I am able to exclude income earned outside of NYC from my NYC tax return, right?  Also can I get any credit from NYS based on my paid NYC tax. Please help me! Thank you experts!