What´s the main difference between a metal and nonmetal in terms of atomic structure of elements ?
metals are conductors. electrons are free to move
nonmetals are dielectrics. electrons are bound to the nuclei.
conductors reflect all of the light from their surfaces. dielectrics relfect some of the light from their surfaces (like from the surface of water)
you might want to study same electrostatics.
To make it clear (and so you should go back to your solid state physics book), electrons are not completely free in a metal. In some cases, we model them to be free, but they still "belong" to an atom. The only difference is that, the electrons need very little energy to go off from the valence band.
If I had to nail down what counts as a metal, it would be the existence of free charge carriers at zero temperature. Or equivalently, the existence of finite current states arbitrarily close to zero energy.
A common way for this to occur is if there are charge-carrying excitations at arbitrarily low energy --- these excitations can be collective or otherwise complex.
The links above point out several ways in which a material can fail to have this property, and some other properties that all follow from the above summary. However, the line is not absolute --- there's definite grey areas no matter how you try to define it.
On a slightly off-topic point, this is the kind of question where there is no one right answer. Condensed matter is about the simple answers --- but here, there's not really a *simple* yet completely correct answer. It entirely depends on the OP's background and purpose. For a school course some words about valence electrons, or even rough pictures of bands would be sufficient. For an advanced undergraduate course I would expect a discussion of Bloch wavefunctions, band dispersion and Fermi surfaces. Beyond, I expect people to know better than to ask.