I really don't wanna write a walkthrough for what is a short game but I'll give a hint.
After you open the main gate and go through: On the far left side you activate something. In the middle you find something, on the far right you activate something. Now you're ready to leave by going to the far end, beyond the middle.