Criteria used in the court for criminal responsibility

Describe the criteria used in the court for criminal responsibility and competence to stand trial.