Rule 1: Electrolysis and hydrogen
If the liquid contains hydrogen, then hydrogen will always form at the cathode and be given off in bubbles, unless the solution contains a metal that is less reactive than hydrogen.
You can see which metals are less reactive than hydrogen by looking at the reactivity series:
So the electrolysis of a copper chloride solution (CuCl2 + H2O) produces copper at the cathode, because copper is less reactive than hydrogen; whereas the electrolysis of a sodium chloride solution (NaCl + H2O) produces hydrogen at the cathode, because sodium is more reactive than hydrogen.
Hydrogen > then according to the reactivity series