Complex sentence: He entered the army as ensign in the 26th foot (Cameronians) in 1797, was captured by French privateers when he was on his way to join his regiment in Canada, and was detained a prisoner in France for a year before he was exchanged.
Split into simpler sentences: He entered the army as an ensign in the 26th foot (Cameronians) in 1797. He was captured by French privateers when he was on his way to join his regiment in Canada, and was detained a prisoner in France for a year before he was exchanged.