Judges Act Article 15

A judge shall not participate in any political party, political organization, or their activities during the term of services, and shall withdraw therefrom if already joined before being appointed.Any judge who seeks election for any kind of public office shall resign from the judgeship position or retire or take severance in accordance with the law before the anniversary of serving term in the respective public office. Any judge who participates in a re-election , special election , or the legislature election following the dissolution of the Legislative Yuan by the President shall do the same before submitting the registration for that election.No judge may be registered as a candidate for the election of public office for violation of the preceding paragraph provision.
中文原文 法官法第15條
法官於任職期間不得參加政黨、政治團體及其活動,任職前已參加政黨、政治團體者,應退出之。
法官參與各項公職人員選舉,應於各該公職人員任期屆滿一年以前,或參與重行選舉、補選及總統解散立法院後辦理之立法委員選舉,應於辦理登記前,辭去其職務或依法退休、資遣。
法官違反前項規定者,不得登記為公職人員選舉之候選人。

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