Complex sentence: In 1862, he was captured by the Confederates while scouting before the Battle of Antietam within Confederate lines in civilian clothes while gathering information for General George McClellan.
Split into simpler sentences: In 1862, he was captured by the Confederates while scouting before the Battle of Antietam. He was well within Confederate lines, garbed in civilian clothes, while gathering information for General George McClellan.