Phase transitions of hydrogen in metals