Usually (ignoring transition metals, as they kinda get trickier), the element's valency can be found out by its group (column) number. Usually, we ignore the transition metal block while counting these columns, so Aluminium is in group 3, for example. Since Aluminium is in group 3, it has 3 valence electrons.