How to correct error 500 on IIS web server?

Im having trouble with a randomly appearing error 500 on a web app hosted on an IIS web server, the error shows up only on a specific page and rebooting the server seems to be the only thing fixing it.

The page is used to send mails so it can send large POST requests and take some time to execute.
The error is never showing up while executing requests, it shows up when I stop using the page and come back after some time.

On a local instance of apache2 and Php there is no problem.

Also I dont know where to look in order to find logs or more details about the error.

Thanks for your help.

What i’ve tried :

-Increase php memory limit.
-Increase php execution time limit.
-Increase POST and UPLOAD limit.