The only number of flags you should have is 1, 3, or 5. Tiny maps would have 1, regular maps 3, and larger maps 5. One should be in the center of the map. The other ones should be equidistant from each team's spawn to make it fair.
In a map with 1 flag, think snoppis. IMO CAH is actually fun in snoppis. One flag would suit 4 to 8 players imo.
With 3 flags, each team will have a base flag or a flag just outside their base, in either case, don't have the flag right where they spawn. So, at where a ctf flag would be or a bit further. And then 1 flag in the center. The layout should allow for at least some level of flanking. Or the battle for center will be 1 dimensional. 3 flags would suit 8 to 14 players.
Note, I have seen it said that there is no point in having a base flag in CAH since "the team will always control their own base flag". But imo, there is a point, which is to allow for fast sneak back door caps to break up hard camps in center. Without this, you would lose a valuable counter to camping. And we all know camping in UrT is rampant and slows the game down. The issue is that a smart CAH team would realize they only need 2 out of the 3 flags, and not bother risking trying to cap the 3rd enemy flag which would obviously subject them to death, weakening their hold on center. It is only the assumption that players will make that aggressive move that makes people think that it's enough to combat camping - but there is no wise reason for the players to make that move.
With 5 flags, I would put the base flag at around the same location as a CTF flag. The center flag is obviously in the center of the map. The other 2 flags you have some options for how to place those. They can either be "in a line" between the 2 bases, OR, you can place them on opposite sides of the map (on the left and right sides) depending on how you want the map to flow. 5 flags would suit 12 to 20 players. You want at least minor flank routes to the 2nd flag from the enemy base (ie: at least 1), and you definitely want good flanking access to the center flag.
If the enemy is able to camp the middle flag really well, it could make the game boring. So, you need to have route(s) for a team to circumvent them and back door cap the flags behind middle.