The element that has only two electrons in its valence shell is helium (He). Helium is located in the noble gas group of the periodic table and has an electron configuration of 1s^2, which means it has two electrons in its valence shell. Being a noble gas, helium has a fully filled valence shell, making it chemically inert and extremely stable.