The following article gives you a great deal of information about NY's Warranty of Habitability.
Explore the balance of tenant rights and landlord duties in New York, focusing on habitability standards and remedies for lease violations.
legalclarity.org
You can read the statute section 235-B at:
Justia Free Databases of U.S. Laws, Codes & Statutes
law.justia.com
You can read the case decision referred to in the article (Park West Management Corp v Mitchell) at:
scholar.google.com
So, does all that give you the right to quit paying rent while you remain there for the next three months?
Well, you and anybody else, have the ability to withhold rent, but it doesn't come without risk. The obvious risk being that your landlord doesn't agree with your opinion as to habitability standards and files an eviction lawsuit for non-payment. You certainly don't want that on your record. On the other hand he might not. No way to predict. No guarantee that there would be no consequences. It's a gamble.
Other options include, but might not be limited to, asking for a rent abatement, asking for an early termination. If he says no, then you get to decide whether to take unilateral action.
A word of caution. Habitability issues arise when the condition of the property is so bad that it effects the health and safety of you and your family badly enough that you are compelled to pack up and get out right now. That the place is run-down and doesn't meet code is not that.
Study up and think carefully about what you do next.