Town Hall 9 is a tricky place to be. Whilst the key factor in designing a TH9 base is to avoid being three starred, there is some value in bases that draw a few failed attacks before getting two starred. I think the focus on low TH9 bases should be 100% on making it as hard to three star as possible. Having some bases in the middle order that cause trouble for weak TH9 GoWiPers to two star can add value though. The top TH9 bases should probably focus more on defending the third star again, as these will be more likely to draw attacks from TH10 attackers who will two star any TH9 easily anyway. For anti-three star bases, avoid anything that completely surrenders the two star (for instance a base with a very exposed TH that could be two starred by TH8 dragons just gives the enemy more TH9 attacks to try to three star it).
The main TH9 two star attacks are GoWiPe, GoWiWi, Giant-Wiz (these all can become three star attacks if you have weak walls or few compartments), Dragons, Lavaloonion. The main three star attacks are GoHo and GoLaLoon.
A quick look at some example bases, one I made soon after turning TH9 that is no longer in use, and a few I just found from a quick internet search.
This is one of the first TH9 bases I made. Whilst I think it'd be decent against GoWiPe/GoWiWi style attacks due having a decent number of compartments and being pretty well spread out, with some high HP buildings inside the base to slow down enemy troops, it never got used due to some big flaws.
Swapping the mortars with the storages next to them would help a little with slowing down the progression of balloons to the ADs, but I abandoned this base because I just couldn't see any good way to get good double giant bombs into the base.
I thought this internet base looked quite interesting. Whilst I think a GoWiPe from the north is a pretty straightforward two-star, I can see some weaker GoWiPe efforts going wrong. I struggle to see any standard GoWiPe/GoWiWi approach that is likely to three star it due to the mixed open and closed layout making it very hard to control pathing and keep the dps troops protected by tanks throughout the raid. Despite the very exposed east AD, pathing balloons to the other ADs isn't trivial so I think it'd be decent against Lavaloon type attacks. I don't like the lack of double giant bombs, especially as the bombs in the west compartment can be covered with one heal, so I'd change things around a little to make it more unfriendly (maybe move the tesla north of the TH up a few spaces to the NW and then slot a double giant bomb in between the mortar and AD).
If I was attacking it, I think a witch-heavy GoHo would be quite effective. A two-Golem GoWiWi+Heroes approach from the South with a jump on top of the BK should take out the open section, the heroes and the cc, and the two central compartments. A small hog force with even just two heals should be enough to then clear out the north sections. We don't see many hybrid attacks like this our wars but, just in case, I'd try to move the AQ somewhere away from the open channel personally.
I found this OneHive style base in this collection of designs. I think we should probably start using more of these types of bases (in the recent war where 8 of 11 of our TH9s got three starred by simple GoWiPe/GoWiWi one of the bases left standing was a copy of a OneHive base, despite having the weakest walls of all our TH9s). Personally, I'd avoid ones like this with such seriously exposed Town Halls though. It's just giving away the two star too easily, in this case I think a decent TH8 could two star it with dragons.
Whilst I think a really good GoLaLoon could three star it (the NW ADs in particular look pretty vulnerable, and the east one is en route to the AQ kill), we rarely see them. The double giant bombs both look good; it's hard to see any path hogs can take to avoid triggering both bombs simultaneously. The majority of GoWiPes/GoWiWis are likely to end in two stars. Ultimately I think if we used mostly these types of bases, we'd see three stars being much rarer. Then the three stars we get against the enemy TH9s would generally be war-winning.
If you've got an hour and half to spare, this guide by OneHive should cover everything and more that you need to know about TH9 base building.