Complex sentence: Yao had been working as a security adviser to President Tsai Ing-wen when, on 10 August 2016, he was appointed Deputy Secretary-General of the Presidential Office.
Split into simpler sentences: Yao had been working as the security adviser to President Tsai Ing-wen. On 10 August 2016, he was appointed to be the Deputy Secretary-General of the Presidential Office.