Another way to say "a captain is for commanding a submarine." is "a submarine is commanded by a captain."