If your main, primary home (your domicile in tax terminology) remains in NYC, then for tax purposes you continue to be a resident of NYC during temporary absences.
**Answers are correct to the best of my ability but do not constitute tax or legal advice.