Habitability of terrestrial-mass planets in the HZ of M Dwarfs – I. H/He-dominated atmospheres