A coxswain is a person in charge of steering and navigating a ship. In crew, it's the person sitting backwards in the boat, tasked with rudder control and command. The word was borrowed in the early 1300s as cockswain (at one point, cokswain was also an accepted spelling). That comes from the words cock, meaning "boat", and swain, meaning "boy". "Boat boy" makes a lot of sense. Cock has nothing to do with the definitions meaning "rooster", "penis", or "tilt": it developed on its own from Old French coque, meaning "canoe". That comes from coco, a word for "egg" (apparently because boats look like shells), which has an uncertain origin. Swain, meanwhile, also meant "servant" and could also be spelled swayn, swain, sweyn, and swein, eventually tracing back to Old English swegen, possibly from PIE swe, "oneself".
Adam Aleksic has been described as the internet's sixth most famous etymologist. He loves writing about himself in the third person, he's a freshman at Harvard University, and he has disturbing interests in linguistics, vexillology, geography, board games, limericks, and law.
The Etymology Nerd