Complex sentence: In 1808 he became private secretary to Count Ruis de Castilla, president and captain-general of Quito, where, on the outbreak of the Ecuadorian War of Independence, he joined the insurgents.
Split into simpler sentences: In 1808 he became private secretary to Count Ruis de Castilla, president and captain-general of Quito. On the outbreak of the Ecuadorian War of Independence at Quito, where he was stationed, he joined the insurgents.