My apps close when I try to minimise them. How can I fix it? I have xperia xz (F8331) with 6.0.1 system. Phone is not rooted and developer options are active.

When I press the sauare button on the bottom of my screen as shown

And I go to another app This app restarts itself instead of running from the point where i left it. What I want to do is minimize the app and then come back to it. Sometimes it will happen, but most of the time as I said the app restarts itself. It is especially annoying when I play games. Is there anything that I can do to make sure the apps stay minimised and not closed. Thank you.
As you enabled the Developers options, you could've enabled the Do not keep activities mistakenly. Check it and disable it. 

Check the screenshot, options may differ since the image is from Samsung Galaxy.