How to write a PhD thesis in three months?
Make an outline and a schedule, then follow the schedule.  Include time for revision and feedback in your schedule.  

If you know all the content already, the writing can be done much faster than that.  In my field, it is only necessary to write about 90 generously spaced pages, so three months is less than a page a day.  In more verbose fields, your thesis need not be more than 500 pages, so that's an achievable 6 pages a day.

The real problem is when you do not know the content you need to write - that part we cannot help with here.