Complex sentence: African-Americans served on both sides of the war in the capacity of both fighting men and slaves.
Split into simpler sentences: African-Americans served on both sides of the war. In the capacity of both fighting men and slaves.