Complex sentence: Apokaukos sought further advancement by trying to convince Kantakouzenos to declare himself Emperor, and when the latter refused, Apokaukos secretly switched his allegiance.
Split into simpler sentences: Apokaukos sought further advancement by trying to convince Kantakouzenos to declare himself Emperor. When the latter refused, Apokaukos secretly switched his allegiance.