|Ice cream treat at Modern Toilet in Shenzhen, China...|
There are several poops in English, but the one we are concerned with here is first attested in 1689 as nursery slang for "to fart," which evolved to mean "to defecate" by 1882. The slang term derives from poop meaning "to produce a short blast of sound, as with a horn," which is first attested by Chaucer in 1390. The word is considered imitative, much like Middle Low German pupen ("to break wind) and Dutch poepen ("to defecate" or "to copulate").
Nautical poop is unrelated.