It really depends on where you live, everywhere has different laws so its always a good idea to look up the animal ordinances where you live.Just checked and there isn’t a law on coup size where I’m at. I didn’t know that there were laws in general so I appreciate you sharing that with me.
Where we lived when we first got chickens the city allowed them by exclusion. Meaning chickens were allowed by virtue of the fact that there was no law against them within city limits. That's how it works in most rural areas too, the county or township doesn't prohibit chickens so people who live out in the country are allowed to keep them as long as they aren't violating any welfare laws that may be in place.
Where I live now, we just got the city to change the animal ordinance from specifically prohibiting chickens to specifically allowing them with restrictions on coop size and location as well as number of birds and what can be done with them. The new ordinance specifies they are "for personal use" meaning technically we can't sell meat or eggs from our chickens (which is why anyone who pys us for eggs is making a donation to our feed fund, not buying eggs). Our law also specifies that the chickens can't be free ranged, they can only legally be out of the run/coop if the yard has a 4ft fence and they are being supervised.
When the city was considering the new ordinance they looked at a bunch of other cities chicken laws. Some required registration, licensing, or permits, some required neighbors give permission, etc.