You can check this for just a reference for the requirement in case you apply for it inside Thailand. This is general information. You need to check with your local immigration for the exact requirements there
*********************************************************************************************************
*******
/9.FOR-RETIREMENT-PURPOSES-50-YEARS-OLD-NON-O.pdf