The guide attached is derived from IRAS showing how one can fill up the IR21 form when a foreign staff had resigned from the company.
Generally, when a non-Singapore Citizen employee (i.e. foreign or Singapore Permanent Resident employee) ceases employment with the company in Singapore, goes on an overseas posting or plans to leave Singapore for more than three months, the company is required to seek tax clearance for him.
As an employer, the company has the responsibility to file the Form IR21 and withhold all monies due to the employee for tax clearance purpose. This applies to all work pass holders including Personalised Employment Pass (PEP) holders.
Attached please find the PDF user guide from IRAS or alternatively you may wish to visit this link