Electrons are found in orbitals, which are the regions where electrons are highly likely to be located. These orbitals are such as 1s, 2s, 2p, 3s, 3p, 4s, 3d, etc. shown with increasing energy level.
Iron has 26 electrons, thus it can be written as [Ar]3d64s2.
An orbital is considered stable when it is half-filled or fully filled. Thus for the case of 4s, the maximum number of electrons it can contain is 2, and thus the 4s is fully filled, as indicated by the superscript '2'.
Iron loses 2 electrons so that it would have an empty 4s orbital. However, there are still 6 electrons in the 3d orbital, while a 3d orbital is half-filled when there are 5 electrons, or is fully-filled when there are 10 electrons. Thus, Iron 2+ is less stable and it tends to lose an additional electron to form Iron 3+, which has a 3d orbital containing 5 electrons, making it a stable ions.