Conditional statement help

I don't think your latest version isn't going to work as intended. Assume that S1 is low and the other two are high. The first if turns on solenoid one and the water pump. Very shortly after, the second if will be false (because S2 is high), so it turns off solenoid two which is ok and then turns off the water pump, which isn't.

One way to do it is once you detect a need for water, set the outputs and then loop waiting for the switch to go high again. A timeout in the loop might help, which would also give the other tanks a turn.

More simply, put a long delay between each if so that say, ten seconds of water can flow.