Atoms contain energy levels, which have orbitals that can hold only a certain number of electrons.
The energy levels of an atom are represented by the horizontal rows on the periodic table.. There are 7 rows, 7 energy levels.
Each energy level has orbitals.
The 1st has an s orbital.
s orbitals can only hold 2 electrons and is considered "full" if both electrons are there.
The 2nd has one s orbital and 3 p orbitals. each of the 3 p orbitals can hold 2 electrons, for a total of 6 p electrons.
the 3rd has 1 s orbital and 3 p orbitals. See above.
The 4th has 1 s orbital, 5 d orbitals, and 3 p orbitals. The d orbitals can hold 2 electrons each for a total of 10 electrons.
The 5th is like the 4th.
The 6th has 1 s orbital, 7 f orbitals, 5 d orbitals, and 3 p orbitals. f orbitals hold 2 electrons each for a total of 14 electrons.
The 7th is like the 6th.
Now in Period 4, the d orbitals are lower in energe than the s orbitals, so the s and p orbitals are the "highest energy levels".
This holds true for all the energy levels with d orbitals.
In the 6th and 7th Period the f orbitals are lower energy than d orbitals which are lower energy than the s orbitals. Again the s and p orbitals in these periods are the highest energy levels.
Valence electrons are the electrons in the highest energy level of the atom (the s and p orbitals). The maximum number of electrons that you can have in these orbitals is 8 ... thus the Rule of Eight. An atom is considered "stable" if all of their s and p orbitals are filled with 2 electrons. (Hydrogen and Helium only have 1 s orbital -- no p orbitals -- so therefore they are filled with 2 electrons instead of 8),
An atom will gain or lose electrons in order to "satisfy the rule of 8". In other words, if an atom has LESS than 4 electrons, this atom will LOSE all the electrons in its outmost s and p orbitals so that the electrons that are left are in a lower, filled energy level.
If an atom has MORE than 4 electrons it will add as many electrons as it needs to make 8. It does this by taking electrons from another atom that wants to lose them or by sharing electrons with another atom that also needs them.
If an atom has FOUR electrons in its outer s and p orbital it can either GAIN 4 electrons or LOSE 4 electrongs. This depends on what other atom it is reacting with. If it reacts with an atom that wants to get rid of electrons, this atom will take them on. If it is reacting with an atom that wants to add electrons, it will give them up. However, in these last two cases, the atome doesn't totally give them up, it shares.
Now. when atoms gain, lose or share electrons they take on a charge: one + or - charge for every electron that the atom gained, lost or shared. For example: Mg has 2 electrons in its s orbitals. It would like to have 8. Adding 6 electrons is too expensive so Mg gives up its 2 electrons to someone else that wants them and drops down to the lower energy level which is filled. Since Mg now has two LESS electrons than before it has a 2+ charge and is called an ion. On the other side of the periodic table, chlorine has 7 electrons in its s and p orbitals, it wants 8. It is cheaper to add 1 electron that it is to get rid of 7. So, chlorine will take one electron from some other atom that doesn't want it. When it does, it will have 1 more electron than protons, and therefore will have a 1- charge.
Look at your periodic table. The vertical rows are called groups. Elements in the same group have the same number of electrons in their s and p orbitals (valence electrons). For groups 1, 2, and 13-18 the group numbers will tell you how many electrons are in the outmost energy level. Groups 1, 2 are as is; groups 13-18, subtract 10 from the group number (this accounts for the lower energy d electrons).
The elements in groups 3 - 12 do not work this way. These are the transition elements and they can make more than one kind of ion depending on what they react with. You either have to look up valence or have to figure it out from the compound that it is making.
In making compounds, positive and negative ions come together in such a way that the total of the pluses and negatives = 0.
For example: in H2O
H is in group 1. it has 1 electron and needs two. It will share its one electron with another element that wants one.
Oxygen in in group 6. It has 6 electrons in its s and p orbitals. It wants 2 more electrons so will share with someone that wants to get rid of their electrons.
So, it will take two H ions (H+) to mix with one oxygen ion (O2-) to make a molecule so that the overall charge on the molecule = 0
All metals (everything to the left of the "stairstep") make positive ions. All non-metals make negative ions.
The elements in Group 18 do not gain, lose or share electrons. Their valence shell is filled with 8 electrons already. These elements do not make compounds under ordinary conditions. These are called the nobel, or inert gases.
In the electron dot diagram, take the symbol for the element and then start putting 1 dot for each electron that is in the outer s and p orbital (Look at the group number). Do this like the N, W, S, E of a compass, putting one electron at each compass point and then double up as you go around. DO NOT PUT MORE THAN 2 electrons at each corner. Do this for all of the elements in your compound. Now. Join them together in such a way that BOTH elements have satisfied the rule of 8. All atoms except H and He will need 8 electrons. H and He will need 2.
It takes 2 electrons between to atoms to make a single bond. For each bond, you need two electrons, so for a double bond there will be 4 electrons between two atoms, and a triple bond will have 6 electrons between the atoms.