This article is based from my youtube channel "abhigya science videos". This is the link to the channel's homepage: https://www.youtube.com/channel/UCT16PTbgxgn_I5jJU8xi_bQ
Electron Configuration is the way that electrons configure themselves in atoms. Atoms are made up of a nucleus and numerous electron shells. Each of these electron shells is made up of one or more subshells. These subshells, in turn are made up of orbitals. There are four types of subshells: s,p,d, and f. Each orbital( the thing that makes up subshells) can hold at maximum two electrons. The electrons in an orbital must have opposite spins. The number of orbitals in each of the four subshells differs, and determines how many electrons that subshell can hold. Similarly, the amount of subshells and what type of subshells, in each shell determines how many electrons that shell can hold. The figure below shows how many electrons each subshell can hold. The first shell, also known as the k shell, ( the first shell is called the K shell, the second shell is called the L shell, the third shell is called the M shell, etc.) has only the s subshell in it. That means the K shell can hold 2 electrons in it. The L shell has the s subshell and the p subshell in it so it can hold 8 electrons, and so on. The maximum number number of electrons any shell can hold is 32 electrons, that means the shell has all the subshells in it. The N shell ( fourth shell) and all the shells after it all can hold 32 electrons.
The filling of electrons in orbitals follows the Hund's rule. Hund's rule states that each orbital in a subshell must be filled once, before each orbital gets filled twice. For example, the p subshell has three orbitals in it, the tree orbitals are called px, py, pz. Each of the three orbitals must have one electron each before any of them get a second electron.