The CPSC suggests installing a fence or other barrier completely around the pool. If the house is part of the barrier, the doors leading from the house to the pool should be protected with an alarm or the pool should have a power safety cover. The fence or other barrier should be at least 4' high, with no foot or handholds that could help a young child to climb it.
Vertical fence slats should be less than 4" apart to prevent a child from squeezing through.
For any pool barrier, the maximum clearance at the bottom of the barrier must not exceed 4" above the grade or 2" above non-solid surfaces such as dirt and grass.
Gates should open out from the pool and should be self-closing and self-latching with the release mechanism 54" or more from the bottom of the gate. Traditional mechanical hinges and latches for gates often fail to close the gate properly. The new generation of hardware, latches that are magnetically triggered and tension adjustable hinges, provide a reliable, self-closing gate. These innovative products have now become the standard in pool gate hardware.
These national guidelines, courtesy of Master Halco, present standards for pool fencing. The law can vary by town, however most have adopted these standards.