Both helium and beryllium have 2 electrons in the valence shell.But helium s holding its electrons in the first subshell(1s) While beryllium is holding its outermost two electrons in the second shell (2s). Thus helium is having its electrons in the innermost shell which is under the very strong attraction of its the electrons can't take part easily in a chemical reaction and therefore it is a noble gas(inert gas). But it is not the same in the case of beryllium.Its valence electrons can take part in a chemical reaction and hence it is categorised in the metals.
The electronic configuration of elements is 2,8,16,32.......
helium has 2 electrons in its first shell that is its octate ( last shell), while beryllium has 2 electron in its second shell and second shell electronic configuration should have 8 electrons not 2 so it is not noble gas