Original: He left office in 1801, but was Prime Minister again from 1804 until his death.
Simplified: He served as Prime Minister from 1783 to 1801, and again from 1804 until his death.