I'm a NYS landlord for 30 years, and believe me, if there is such a law, I would know about it.

From time to time, besides this, I would hear people ask "they heard that if they got a new job where they have to relocate, they can legally get out of he lease too". There is no such thing either.

Buying a house, and relocating for a job are 90% of the reasons why people in ages from 25 to 35 have to move, and when I asked an attorney about this years ago, if this is true, his answer was "why bother with a lease then"?? My attorney ask me "are you (the landlord) allowed to throw the tenant out if YOU need to move into his unit, or if you move out of state for a new job"?? NO.

Now, if you moved, the landlord is legally required to mitigate his damages, and attempt to get the place re-rented, at which point, you'll still be on the hook till he re-rents. The risk here is he can take his time and take 6 months to re-rent, maybe a bad market, and you are still on the hook.

BTW, most of my tenants nowadays are "long term", and I only rent to people whose situation is they're NOT buying a house next year, or NOT relocating for a job next year. How do I know this?? Experience, I guess.