I’m assuming from your tags that you’re using Gnome DTE. Have you installed Gnome Tweaks from Software? If not, I recommend giving that a try. Once installed, open it and search for ‘focus’ or go right to the Window section and set the focus as you’d like.
If you want to do it with gsettings because using it in a script, check here how to extract it from the db while starting gnome-tweaks with the -v parameter.
Before I steer you further from you desired goal, are you using the Gnome DE (Desktop Environment - I apologize for the incorrect abbreviation used previously)? If so, is a graphical (GUI) solution to your question acceptable, or are you set on editing a configuration file either from the command line or a graphical editor? As has been mentioned, more info would be helpful.
Gnome Tweaks is a GUI configuration tool that allows a user to customize the DE easily. You can find out more about it online.
You need to set the focus-mode to either mouse or sloppy, as mentioned in the linked post.
$ gsettings set org.gnome.desktop.wm.preferences focus-mode mouse
mouse makes windows become focused when your mouse enters the window, and unfocused when your mouse leaves the window.
sloppy only focuses on enter, but doesn’t unfocus when leaving.
Setting auto-raise to true will additionally make focused windows rise to the top. Without it, windows will remain at the same layer even though they become focused.
Yes, I have a German keyboard layout, but I have set the system language to English, it helps when reading English manuals.
Yes, I love GUIs more than the bash. I have just installed this Gnome Tweaks (rpm-ostree install gnome-tweaks) and I have changed the setting as you said, and it works like a charm!
Thanks, @gregbrannon@Ilikelinux and @jn64 (too late, did it using the GUI, but I accepted your answer as it does not require an installation)