To enable mouse-triggered dock hiding (instead of only hiding it when a window overlaps it), you can use the following command:
gsettings set org.gnome.shell.extensions.dash-to-dock intellihide true
After that, turning on autohide option in System Settings will activate “true autohide” instead of the default intellihide.
To reverse this:
gsettings set org.gnome.shell.extensions.dash-to-dock intellihide false