You can do that via System Settings > Keyboard (or gnome-control-center keyboard in terminal): go to Typing and set Modifiers-only switch to next source to Caps Lock
Alternatively,could set the corresponding xkb option (which is what the above does underneath) via gsettings or dconf-editor: navigate.
Navigate to org > gnome > desktop > input-sources and add grp:caps_toggle to your xkb-options:
Note each option is enclosed in single quotes, options are separated by comma+space.
On older gnome3 releases you could do that also via System Settings > Keyboard (or gnome-control-center keyboard in terminal) > Typing > Modifiers-only switch to next source to Caps Lock
This was removed from recent releases (see sanmai's answer for alternatives to dconf-editor).

