The law provides that a short-term rental is any rental for less than 30 days unless a permanent resident is present during the stay.
However, according to New York’s Housing Maintenance Code, no more than two short-term renters or “boarders” can stay with the permanent resident at a time.
For further clarification, the MDL applies to a residence or home of three (3) or more units.
Moreover, New York City Building Code and Housing Maintenance Code also prohibits Short Term Rentals in one or two family homes without the presence of a long term tenant or the owner him/herself present during the short term stays. 
Remember, if you are looking to rent out your apartment, you may be able to sublet.
Tenants in apartments with three or more units can sublease their apartment if they will be away for at least 30 days.
In most leases, subletting requires the landlord’s approval. If you are looking to sublet, review your lease and talk to your landlord.
The information above is intended to provide limited information only and is not legal advice. The laws relating to Airbnb, sub-leasing, short-term rentals, and evictions in New York are complex. If you are a party to a matter concerning an Airbnb/online marketplace hospitality service and otherwise need further guidance in this or a related area of law, Singh & Rani, LLP can assist you.
1. 2017 WL 87171 (Sup. Ct. NY Cty. 2017).