Yaar coaching mein akar pooch lete.
It has to be valence electrons or rather I must say the electrons that belong to the whole system rather than any particular atom.
(Well I am reffering to the Band Model)
About the temprature, to release the valence electrons too,energy required is very high.