Defending the Tool Rush is a very complicated and long-debated matter. I'll try to give you short analysis.
Everyone seems to agree that on land walls and bowmen are among the best anti-tool defenses, and some maintain that running your villies from large armies (except scouts) to avoid losing them before your own army can do its job is also wise. Axemen are too long to research, both scouts and towers are usually too expensive to be worthwhile. Slingers do well vs bowmen and towers (though tower rushes are extremely rare), bowmen do well vs axemen and scouts (and other bowmen), and walls do well vs anything but slingers. That leaves slinger rushes, probably the best defenses are either boning them (but you'll lose villies, which could cost you the war) or running (you'll lose your town, and you're vulnerable to a follow-up scout rush).
On the sea, probably the best tip I can give you is (unless you have a *lot* of docks) don't build your warboats right in front of the enemy's! If two warships fight your warships coming out one by one they can kill 3 of them, so just imagine if they have 6-7 warships around your dock! Instead, build your warships at docks away from the sea battle, so you have a chance to mass them before fighting. Also, massed land units tend to be more powerful than warships, so try to use them when possible; you wouldn't believe how effectively a pack of compies can sink a trireme fleet.
I think yammy is actually one of the best civs for defending from tool rushes, and deserves and extended explanation.
1. they have a bit of an econ bonus, enough to get them to bronze faster than most civs
2. their villies can run from bowmen/axemen/slingers, saving your econ while your army does the fighting
3. cheap scouts - you can use them to hunt down enemy forwards, or to launch a pre-emptive strike
4. tough fishing boats - while this seems useless, it gives your scout ships 33% more time to rescue them, and/or 33% more of them will survive the raid
5. tough scout ships - I still think it's not as powerful a bonus as the cheap minoan scout ships (which means +40% hp and +40% firepower) or the hittite range bonus (which helps a lot in large sea battles), but combine it with the tough fishing boats and it can be a good defensive advantage.
6. cheap cavs - cavs rip through tool units like nothing else, and since yammy has cheaper ones, it's easier for them to get enough gold using trade boats to end the tool fighting for good, and of course kill tons of villies while they're at it
Other good civs for tool defense might be:
. shang - fast econ, tough walls
. assy - fast-firing bowmen, fast villies like yammy
. roman - cheap buildings, cheap towers
. phoenie - some wood to spare, esp once you get woodworking
Mid-range civs for tool defense:
. babylon - extra stone for slingers, tough walls/towers, but slow to bronze
. sumie - tough villies, better farms if you're kicked off the sea
. hittite - nice bonuses, but only really useful once you mass those units so an early strike can still wipe you out, and slow to bronze
. mino - nice boat bonus if you make extra docks, and usually lots of extra food for a land army - but usually slow to tool because the boat food takes a while to start coming in
. palmy - armored villies you can't easily afford to lose, a powerful econ to produce a tool army (esp wood for navy!), trading bonus can help get some gold very easily in team games for cavs/camels/compies in bronze if your gold mines get captured
. persian - +66% hunting rate can give a serious boost, but if you spend too much on a fight you'll lose your speed advantage - usually best to make only a few units at each step and continue moving up the tech tree, unless you *have* to fight
Civs that aren't that good vs tool rushes:
. mace (LoS is nice but imo not enough)
. choson (great tower bonus but only once you have many)
. egypt (no tool bonuses)
. carth (no tool bonuses)
. greek (no tool bonuses)