I live in rockland, NY but work in NYC Do I pay NYC taxes?

I live in Rockland, NY but work in NYC Do I pay NYC taxes or only New York State taxes or both, and do I have to fill out the 1127 form?