Complex sentence: Defeated, he retired again to his farm before being elected president in 1840, and died of pneumonia in April 1841, a month after taking office.
Split into simpler sentences: Defeated, he retired again to his farm. He was elected president in 1840, and died of pneumonia in April 1841, a month after taking office.