As with most elements, the number of valence electrons in a strontium atom depends on its electronic configuration. This is a critical step in the chemical bonding process and determines an element's properties.
Typically, a main-group element (except hydrogen and helium) tends to form an s2p6 electron configuration with its valence electrons. Similarly, transition metals tend to form a d10s2p6 configuration.
The s2p6 configuration is called the octet rule, and this is how atoms of all main-group elements and all transition metals tend to bond with one another. This is a tendency that can be seen in many simple molecules and compounds.
It also determines the electrical conductivity of many elements and whether a molecule is metal, semiconductor, or insulator. In addition, it can determine whether a molecule is stable.
In the case of the element strontium, it has a 1s2 configuration with two valence electrons. This element is part of group 2 and period 5.