The local municipalities generally determine the number of pets that are acceptable within their juristiction, not the state. My experience it is usually up to 2 dogs and/or two cats or some combination thereof. Often rural areas or towns are more likely to allow more. A couple I knew were suckers for stray animals and at one time they had about 6 dogs and 7 cats. It was a challenge for them to find a place to live and they had to move out to the country. Althought that is an extreme example. I'd probably have about 3-4 dogs if I could, but that isn't going to happen unless I move.
I live somewhat in the country in Maine and after you posted about only being able to have 2 dogs, I decided to call my town office. The first 2 people I talked to laughed…like the question was ridiculous. Then I called the code officer. He didn't know the answer but thought it was a great question and needed to call me back after he looked into it. For my town, I can have 5. Any more than 5 and I have to apply for a kennel application.
FWIW, there was a huge problem with a puppy mill in a town about 45 minutes from me. A responsible basenji breeder (BCOA member and not a BYB) who had 7 b's as pets (hasn't bred in a couple years) was put thru the wringer by ugly neighbors because the town passed a new ordinance (after the puppy mill was broken up) limiting the number of pet dogs. This b owner had the dogs long before the puppy mill ever came to light. After a huge fight with the town, she has since been grandfathered, but needs to register as a kennel if she decides to breed another litter.