Act Governing the Employment of Diplomatic and Consular Personnel Stationed Overseas Article 7

In principle, each overseas term for diplomatic and consular personnel shall not exceed six years. Within such a term, diplomatic and consular personnel may be transferred among diplomatic missions. At the end of an overseas term, they shall be transferred back to MOFA headquarters. An overseas term described in the previous Paragraph may be extended or shortened in accordance with policies of the host nation of the diplomatic mission, legal restrictions, or work requirements. If extended, overseas terms shall not exceed nine years.
中文原文 駐外外交領事人員任用條例第7條
駐外外交領事人員一次駐外期間以不逾六年為原則,該次駐外期間內得在各駐外機構間調任,任滿調回外交部服務。
前項期間,因受駐在國(或地區)政策、法令之限制或業務上之需要,得延長或縮短;經延長者,一次駐外期間合計不得逾九年。

English translation for reference only; the Chinese text prevails. Not legal advice.