Read the manual about `rise` and `fall` parameters. These allow you to control how many successive checks must pass or fail before the server transitions up or down (rises / falls). The check interval is used as the check timeout unless you specify a check timeout. See "timeout check" in the manual.
http://haproxy.1wt.eu/download/1.5/doc/configuration.txt