In My Info, you will report that you lived in more than one place and report the dates of residency.
However, if you did not intend to establish residency in New York while a student, you can report your earnings on a New York non-resident income tax return.