Complex sentence: The Confederate capital was abandoned in April 1865 and Lee subsequently surrendered his army at Appomattox Court House, while all other Confederate armies surrendered within a few months.
Split into simpler sentences: The Confederate capital was abandoned in April 1865 and Lee subsequently surrendered his army at Appomattox Court House. All other Confederate armies surrendered within a few months.