The logic is trivial:
if high switch is active turn off relay otherwise if low switch is active turn on relay