How do you figure out how many Valence electrons is in an atom?
The group number of a certain atom is equal to that atom's number of valence electrons only when you are referring to main group elements. The main group elements are groups 1,2, 13-18, with the exclusion of the transition and inner transition metals. I should also add that helium only has two valence electrons even though it is in group 18. This is because helium's electrons only occupy an S orbital, which can hold a maximum of two electrons.
For example, let's say that you have a Ca atom. Since calcium is located in the second row of the periodic table, it will have two valence electrons in its outermost shell.
Here is a more detailed explanation with examples!