Honestly, he should get so big that he can just trapse through the water with his gun above the surface (ala the TA box art). But if he increases in size incrementally and given water depth variance there will always be a point where he is large enough to be shot at but not to shoot back.
If you want to retain your stealth, do not morph your commander. We should probably consider hover modules, though.
As an emergency measure, you can also terraform down a block directly under your commander. This will submerge him.