Metals react with each other and hydrogen according to the reactivity series given as follows
K>Na>Ca>Mg>Al>Zn>Fe>Pb>H>Cu>Hg>Ag>Au
The elements that occur before Hydrogen in the series can displace it from its compounds.
Hence, Potassium, Zinc and Lead displace Hydrogen from the acid and produce Hydrogen gas whereas Gold does not.