To calculate electronic configurarion you need to know several thing first.
Electron Shell
In chemistry and atomic physics, an electron shell, also called a principal energy level may be thought of as an orbit followed by electrons around an atom's nucleus. The closest shell to the nucleus is called the "1 shell" (also called "K shell"), followed by the "2 shell" (or "L shell"), then the "3 shell" (or "M shell"), and so on farther and farther from the nucleus. The shells correspond with the principal quantum numbers (1, 2, 3, 4 ...) or are labeled alphabetically with letters used in the X-ray notation (K, L, M, …).
Each shell can contain only a fixed number of electrons: The 1st shell can hold up to two electrons, the 2nd shell can hold up to eight (2 + 6) electrons, the 3rd shell can hold up to 18 (2 + 6 + 10), and the 4th shell can hold up to 32 (2 + 6 + 10 + 14) and so on.
Subshells
Each shell is composed of one or more subshells, which are themselves composed of atomic orbitals. For example, the first (K) shell has one subshell, called "1s"; the second (L) shell has two subshells, called "2s" and "2p"; the third shell has "3s", "3p", and "3d"; the fourth shell has "4s", "4p", "4d" and "4f"; the fifth shell has "5s", "5p", "5d", and "5f" and can theoretically hold more but the "5f" subshell, although occupied in actinides, is not filled in any element occurring naturally.
See 'Number of electrons in each shell' section under this article.
Atomic Orbitals
An atomic orbital is a mathematical function that describes the wave-like behavior of either one electron or a pair of electrons in an atom. Each orbital in an atom is characterized by a unique set of values of the three quantum numbers n, ℓ, and m, which correspond to the electron's energy, angular momentum, and an angular momentum vector component, respectively. Any orbital can be occupied by a maximum of two electrons, each with its own spin quantum number. The simple names s orbital, p orbital, d orbital and f orbital refer to orbitals with angular momentum quantum number ℓ = 0, 1, 2 and 3 respectively. These names, together with the value of n, are used to describe the electron configurations.
Understand electron configuration notation.
Electron configurations are written so as to clearly display the number of electrons in the atom as well as the number of electrons in each orbital. Each orbital is written in sequence, with the number of atoms in each orbital written in superscript to the right of the orbital name. The final electron configuration is a single string of orbital names and superscripts.
For example, here is a simple electron configuration: $1s^2 2s^2 2p^6$. This configuration shows that there are two electrons in the 1s orbital set, two electrons in the 2s orbital set, and six electrons in the 2p orbital set. 2 + 2 + 6 = 10 electrons total. This electron configuration is for an uncharged neon atom (neon's atomic number is 10.)
Memorize the order of the orbitals.
Note that orbital sets are numbered by electron shell, but ordered in terms of energy. For instance, a filled $4s^2$ is lower energy (or less potentially volatile) than a partially-filled or filled $3d^{10}$, so the 4s shell is listed first. Once you know the order of orbitals, you can simply fill them according to the number of electrons in the atom. *The order for filling orbitals is as follows: 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p, 8s. *
An electron configuration for an atom with every orbital completely filled would be written: $1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^{10} 4p^6 5s^2 4d^{10} 5p^6 6s^2 4f^{14} 5d^{10} 6p^6 7s^2 5f^{14} 6d^{10} 7p^6 8s^2$.
Note that the above list, if all the shells were filled, would be the electron configuration for Uuo (ununoctium), 118, the highest-numbered atom on the periodic table - so this electron configuration contains every currently known electron shell for a neutrally charged atom.
Now you can fill in the orbitals according to the number of electrons in your atom. For instance, if we want to write an electron configuration for an uncharged calcium atom, we'll begin by finding its atomic number on the periodic table. Its atomic number is 20, so we'll write a configuration for an atom with 20 electrons according to the order above.
Fill up orbitals according to the order above until you reach twenty total electrons. The 1s orbital gets two electrons, the 2s gets two, the 2p gets six, the 3s gets two, the 3p gets 6, and the 4s gets 2 (2 + 2 + 6 +2 +6 + 2 = 20.) Thus, the electron configuration for calcium is: $1s^2 2s^2 2p^6 3s^2 3p^6 4s^2$.
Note: Energy level changes as you go up. For example, when you are about to go up to the 4th energy level, it becomes 4s first, then 3d. After the fourth energy level, you'll move onto the 5th where it follows the order once again. This only happens after the 3rd energy level.
For 'How to find quantumn numbers?', see this.