Three sensor binary to connect an output

Hello guys!
I’m trying to make a logic and with three binary sensors, but I’m not getting it, I’m a beginner in the home assistant.
I’m using ESPhome and an ESP12 card.

if( sensor1 == HIGH and sensor2 == HIGH and sensor3 == LOW) {
digitalWrite (Rele1, HIGH);
}
if( sensor1 == LOW and sensor2 == LOW and sensor3 == LOW) {
digitalWrite (Rele1, LOW);
}