How to change location of wp-config.php to folder or 2 folders up?

You shouldn’t move the file because you’d have to change other files which include wp-config.php and these files will be overridden at your next update, but you can move the content of the file ( at least your credentials) to another file two levels up and include() this file in your wp-config.php
This solution should be update save