Chemistry - Werner's theory and complex salts
A certain number of ions, atoms or molecules closely associate around a central atom leading to the formation of distinct entity called coordination complex. The groups atoms or molecules linked to the central atom are said to be coordinated with the latter and their number gives the coordination number.
The non-ionisable units lie in the primary zone or sphere, whereas the ionisable units lie in the secondary sphere and appear as ions in the solution.
In hexammine platinic chloride $\ce{[Pt(NH3)6]Cl4}$ and in potassium ferrocyanide $\ce{K4[Fe(CN)6]}$ four chlorine ions of the former and four potassium ions of the latter ionize in the aqueous solution, whereas six ammonia molecules of the former and six cyanogen groups of the latter belong to the primary sphere or non-ionizable sphere and thus fail to respond to their characteristic tests or fail to ionize. Or you could also say that the chlorine ions in the former and the potassium ions in the latter occupy the primary valencies and hence are ionizable and the ammonia and cyanogen group occupy the secondary valencies and are non-ionizable, while the $\ce{Fe}$ atom in the latter is present in the primary Sphere and thus fails to ionize.
As per your question during the formation of a compound say $\ce{[Pt(NH3)5Cl]Cl3}$, five molecules of ammonia and the chlorine ion (linked by secondary valencies) are present in the primary Sphere and the rest of the three chlorine atoms lie in the secondary sphere. Thus the coordination number of the compound would be six as five ammonia molecules and one chlorine atom are attached to the central metal atom.
Now, every element tends to satisfy both its primary and secondary valencies. A negative ion tends to satisfy both these valencies i.e. primary as well as the secondary valencies. The presence of a negative ion in the coordination sphere reduces the amount of charge on the complex ion by the amount of charge present on it while the negative ions in the primary sphere or the coordination sphere are not ionized.