updated code
int sensorPin = 3;
int relayPin = 5;
int bottleCount = 0;
void setup() {
pinMode(sensorPin, INPUT);
pinMode(relayPin, OUTPUT);
}
void loop() {
if(digitalRead(sensorPin) == HIGH); {
bottleCount++
}
if(bottleCount == 2); {
digitalWrite(realyPin, HIGH);
}
}