We'll cut to the chase and answer this one right away: Yes, your homeowners association (HOA) can stop you from renting out your own place as long as the restrictions are reasonable and uniformly applied.
Generally, one of the most common restrictions you may encounter are limits on how many residences in your development can be rented at any given time. This is designed to protect the integrity of the property values since renters may not keep a property up the same way that homeowners might.
You may also have a waiting period, meaning that you have to actually live in the home for a time before you can rent it. The goal there is to make sure that the development doesn't get taken over by absentee landlords who have no emotional connections to the property. Other HOAs limit the number of times in a year you can rent out your property to different tenants so that the development doesn't basically become an AirBnB or cluster of short-term rentals with revolving tenants.
Assuming that your HOA will allow you to rent out your property, you may face an additional hurdle: Your prospective tenants may have to pass a rigorous screening test. They may have to prove that they have a sufficient income to afford the rental, show a good rental history, pass a background check and be interviewed by the HOA's board -- just like you did when you bought the place.
Just the same, HOAs cannot impose unreasonable restrictions or rules that are discriminatory in any way. If you believe that your HOA is being unfair in the way that they are limiting your right to rent, it may be time to discuss your situation with a real estate attorney here in New York.