This is a bare bones logic diagram, not a complete schematic. It is essential that this circuit be powered from a regulated DC power supply, which requires that you choose a suitable voltage (which depends on the electronic parts you choose), and then include a 78xx voltage regulator IC, where the xx is your voltage, and then wire the output of this regulator to the logic ICs that you use.
The inputs and outputs are Active High, or in other words, positive logic. This is not the only way to do this and may not be the most convenient. It assumes that your water level sensors put out a high voltage when they sense water and a low voltage otherwise. It also assumes that the sensor high voltage is within the input voltage range of the ICs that you choose. The output is active high but you will need a high current switch to power the pump and valve. I have not shown this high current switch.
Here is some theory of operation. G1's output will only go high when both of the inputs are low (i.e both sensors are "dry"). This is our signal to start the pump, so we call this "pump start". G2's output will only go high when both sensors are "wet" so we call this "pump stop". G4 and G5 are configured as an RS latch which is a two state circuit that will remember the last instruction given to it (hence the name "latch"). When it gets a high on "pump start" then the output "to water pump switch" will go high. When it gets a high on "pump stop" then the output will go low. Nothing happens when an input high to this latch goes low again, that is, the latch remembers that there was an input high before. The resistor/diode/capacitor circuit on G3 input generates a short pulse on "pump stop" when you first turn the power on, to insure the latch powers up in the right state under all conditions.