Sulphuric acid - H2SO4
Nitric acid - HNO3
Hydrochloric acid - HCl
The hydrogen wants to cling to the other "bit" in the acid like the SO4 or the NO3 or the Cl. However the metal comes along and is more reactive than the hydrogen. The metal also wants the SO4 or the NO3 or the Cl and being more reactive it gets what it wants. It kicks the hyrogen out of the way and forms a salt, (eg: magnesium chloride, iron sulphate, potassium nitrate) and the hydrogen ends up on its own (H2)
For example, this is a word equation:
Magnesium + Hydrochloric acid ----> Magnesium chloride + Hydrogen
And the balanced symbol equation:
2Mg + 2HCl ---> 2MgCl + H2