Please post your code directly as described in "How to use this forum - please read" at the top of every forum.
And you need to specify your requirements a bit more clearly. I think you probably mean clap twice within a limited time, so say how long. And then also say how long you want to wait to check that there isn't going to be another clap making it too many so the relay shouldn't switch on.
Steve