Use a variable to count the number of times it's HIGH.
No. The variable needs to count the number of times the pin BECOMES high.
OP: Look at the state change detection example, to see how to detect that a pin has BECOME high (or low), rather than that the pin IS high (or low). You want to take action when the pin changes state, not when it is in some state.