There are one or two electrons in the ns sublevel for s-block elements, the sum of electrons in ns and (n-1)d levels equals the group number in d-block elements, and the number of electrons in the np sublevel equals the group number minus twelve in p-block elements.
You can find this info in table 2 on page 147 of the Modern Chemistry textbook.