@Julien *******
you go to your local tax office and ask what you need for a TIN. This is Thailand, there is no general rule for every location, nothing is consistent in this country. So you'll have to see what your particular tax office needs.
Basic documents they will ask for are a bank statement from your thai bank, a work contract showing income and an address in Thailand.
Now, because this is Thailand, there is no way for them to enforce this rule and make you pay taxes here, yet, since they don't check how much money you bring into the country unless you report it yourself. They do however have the right and international agreements to check your accounts in other countries. The chance of this happening is probably around 1% right now though.