Every city / town has its own ordinance. Here in my city, limit is 3 dogs per home. For 4 of more, you need a kennel license.

Yes, I have 4 dogs, no I do not have a kennel license. I simply do not get a city dog license for Ozzy. At his age, and as he was the last one to arrive, I figure he will be on to the next life before anyone figures it out. Could I be fined? Sure. Could I be forced to rehome one dog? Absolutely. I keep a low profile re the dogs, make sure Marlin keeps it down, etc. (Marlin is the only one who barks!)

The city next over has a 5 dog limit.

The cat limits change as well from one town to another. My city does it by having an "anti hoarding" ordinance. If the ACO determines you are hoarding, he can remove cats from your home; even if they are all up to date on vet care etc. (There are guidelines for him to apply, it is not totally subjective; but there is definitely an element of subjectivity about it.)

The city next over limits cats to 3 per home.

Some areas will have breed specific legislation, so you may as well learn all you can about your city. Some require extra homeowner's insurance for certain breeds. (My city may for all I know! It has never been an issue with bichons.)