you get 2 months, then can go to immigration in chiang mai, get another 30 days. after that you have to cross a border, get another 2 months and extra 30 days.
Hey Paul, as far as I know is it not possible to do that anymore. I would recommend to go to a thai embassy in your home country and get a doubly entry tourist visa. I'm pretty sure these are still possible..