In SPM syllabus, you probably will learn that the 3rd shell of an atom can hold up to 8 electrons. This is not really true.
The 3rd shell of an atom can actually hold up to 18 electrons. However, when eight electrons are present, extra stability is gained. The additional electrons go into the fourth shell before the third shell is completely filled. Let us look at the table below:
Let us look at potassium (19 electrons). When the 3rd shell is filled with 8 electrons (2.8.8), the 19th electron will be filled into the 4th shell, but not the 3rd shell, even though the 3rd shell can actually hold maximum up to 18 electrons. This is because the electrons arrangement of 22.214.171.124 is more stable than 2.8.9.
When it come to scandium (23 electrons), after filling 2 electrons in 4th shell, the 23rd electron is filled into the 3rd shell again to make the electron arrangement 126.96.36.199, and we can see that the 3rd shell is finally filled with 18 electrons for copper and Zinc, the maximum number that can hold by this shell.
However, the electron arrangement of elements that have more than 20 electrons is not important in the SPM syllabus, therefore you are taught that the 3rd shell can only filled up to 8 electrons.