The number of electrons in the valent shell of both the elments are same but the number of shells are not same.helium valent shell is 1 which so close to the nucleus and experiences higher force of attraction they do not take part in reaction.Thus it is a noble.beryllium valent shell is 2 though it is close to nucleus it undergo reaction and form covalent bonds.
Helium is a chemical element with atomic number the k  shell is completely filled and it has no it is a noble gas.

beryllium is a chemical element with atomic number's k shell is completely filled but it's l shell has 2 electrons but to become valence it needs 6 more beryllium is a metal and not a noble gas.
1 4 1