There is no universal answer, because a rooster's legality is decided street by street. The same bird who is perfectly lawful on one side of a town line is prohibited on the other, and the rules come in layers — municipal ordinance, zoning, and private covenants — any one of which can settle the question against you.
The three layers of rules to check
Start with your town or county's animal ordinance: many residential zones allow a small flock of hens while expressly banning roosters, and some cap flock size or set minimum distances from neighbouring houses. Next, zoning — a property zoned purely residential may exclude poultry altogether. Finally, if your home sits in a homeowners' association, its covenants are a private contract you agreed to, and they frequently ban roosters or all poultry even where the town permits them. Get the answers in writing from the actual documents before a bird is involved.
Noise is the real-world issue
Even where a rooster is legal, he is loud by design. Crowing starts before dawn, peaks in the morning, and pops up through the day in answer to sounds and rivals; it carries easily across suburban gardens. A legal rooster can still generate a noise complaint, and repeated complaints can cost you the bird in many jurisdictions. Be honest about your distances: a coop forty metres from the nearest bedroom window is a different proposition from one against a shared fence. A rooster can also set off every dog on the street, multiplying the disturbance well beyond his own voice.
If he is allowed, stack the odds
Site the coop as far from neighbours' houses as your plot allows and let buildings or dense planting stand between. A well-darkened coop opened later in the morning keeps crowing contained indoors during the most sensitive hours. Talk to your immediate neighbours before the rooster arrives, keep the flock small and clean, and have a genuine plan B — a rural home willing to take him — agreed in advance, because surplus roosters are notoriously hard to place.
You do not need a rooster for eggs
Plenty of residential keepers solve the entire problem by keeping hens only. Hens lay eggs perfectly well without a rooster — the eggs are simply unfertilised, which is what most people eat anyway — and the flock's social life runs perfectly well under a dominant hen. A rooster earns his place when you want fertile eggs for hatching, or value his work watching for predators and finding food for the flock. If neither applies to you, a hens-only flock gives a backyard keeper nearly everything worth having with none of the legal and noise exposure.
Think before you hatch or buy
Most rooster problems begin with eggs bought as 'hens' or chicks raised before their sex showed. Buy sexed pullets if you cannot keep a male, and if a young cockerel reveals himself, rehome early while he is still easy to place. Not sure how the layers of rules apply to your address? Put a follow-up question to KinsLe's Kimmy; she answers using the KinsLe Answers library, so the checks can be worked through before any bird depends on the answer.