When a Confederate soldier was captured by the Union forces, it was usual procedure to be given a choice of prison, or taking "the Oath of allegience" and joining the Union Army. Many soldiers became Union soldiers as a result of this method. You need to check further to see if he was also in the Union Army. Also, do you have any identifiers, such as a county, date of birth, date of death?