Complex sentence: At sea, when the boat may lean over or roll in the waves, the opening may end up below the waterline; if the seacock is open when that occurs, seawater could flow the wrong way--into the boat.
Split into simpler sentences: At sea, when the boat may lean over or roll in the waves, the opening may sometimes be below the waterline. If the seacock is open when that occurs, seawater could flow the wrong way--into the boat.