Submarines can pass through enemy naval units to attack on the other side as long as there are no destroyers present in the sea zone being passed, correct?
The attacker decides whether to retreat/submerge before the defender decides whether to submerge, so your friend could retreat before you could submerge.