1S2 2S2 2P6 3S2 3P6 3d10 4S2 4P6 4d10 4f12 5S2 5P6 6S2,
where first number in each group of three characters corresponds to electron shell (column number), the letter corresponds to the electron orbital (subshell) and the third number corresponds to number of electrons in that orbital.If you wish to write the electron configuration in order of filling of the orbitals, follow the "cascades" and count the elements that were not crossed out, starting at the top of each cascade and going downward, along the slanted lines:
1S2 2S2 2P6 3S2 3P6 4S2 3d10 4P6 5S2 4d10 5P6 6S2 4f12.
Not all electron configurations derived this way correspond to the lowest atomic energy levels. There are eighteen common exceptions to electron configurations for atoms in the lowest energy state, also called the ground state. Here they are:
Cr (..., 3d5, 4s1); Cu (..., 3d10, 4s1); Nb (..., 4d4, 5s1); Mo (..., 4d5, 5s1); Ru (..., 4d7, 5s1); Rh (..., 4d8, 5s1); Pd (..., 4d10, 5s0); Ag (..., 4d10, 5s1); La (..., 5d1, 6s2); Ce (..., 4f1, 5d1, 6s2); Gd (..., 4f7, 5d1, 6s2); Au (..., 5d10, 6s1); Ac (..., 6d1, 7s2); Th (..., 6d2, 7s2); Pa (..., 5f2, 6d1, 7s2); U (..., 5f3, 6d1, 7s2); Np (..., 5f4, 6d1, 7s2) and Cm (..., 5f7, 6d1, 7s2).
For further discussion on writing electron configurations in order of orbital filling refer to this blog by Eric Scerri.