If a person is certified 100 % mad or insane and commits a crime, he will be exempted from punishment under Thai Law.
However, in case such madness or insanity just comes and goes, or only intermittent, the lawyer of such person has to achieve the burden of proof to show that at the time the offender commits the crime he was actually mentally impaired, otherwise he will receive punishment.