I am specifically interested in countering 6pool early rush as Protoss but you can include other races too.
What you want to do is something along these lines:
You use your first Gateway and Cybernetics core (or second Gatway, or Pylon) to create a wall with a single hole, and you chronoboost out your first Zealot to hold that hole.
In the case of a 6 Pool you should be able to get that first Zealot out just around the time the first 6 Zerglings arrive. Many times this means you won't have the Zealot in time to stop the Zerglings. I highly recommend using the Zealot to block the hole (still) and using your probes to defending against the Zerglings. You should have sufficient Probes (a dozen or so) to hold off lings, but if you chase the Zerglings with the Zealot, his follow up pushes are going to get into your base.
Usually you will use a second Zealot to chase down any remaining lings who have survived to that point.
Normally I don't recommend using a Pylon as part of your Wall because pylons have low health and are susceptible to Baneling busts or pressure later on; I much perfer the wall-in shown in this picture. However, if you scout 6 pool it may not always be feasible to rely on getting that Cybernetics Core down and you maybe forced to use a Pylon or Second Gateway.
Remember, buildings, while they are being built, still act as a wall.
Supplement to tzenes' answer.
If you scout a 6 pool (you should always scout), prefer to get a 2nd gateway instead of a cyber core. A 2 gate zealot push will easily win the game if the Zerg's 6 pool failed to do any serious damage.
Also, as Protoss, always wall off against Zerg; ideally with a wall similar to the picture tzenes has.
Finally, while a 6 pool can be done effectively on almost any map, it is worth considering that a 6 poll is really only common on the map "Steps of War".
"but you can include other races too."
Playing as Z, I really love the 11pool18hatch build. Make sure to scout early to see what's coming.
If you see a super early pool, pump some lings to defend and counter attack. You should have plenty of time to build up defenses when scouting a 6pool.
I usually scout with my 9th.
If he goes for stand 13-15 pool, you have your queen earlier and can pump 7 drones with the first inject - should be almost as good as the other eco-openings.
PS: Don't know too much about P tho :D