Principal quantum number of outermost electron in Be and Li is 2. Hence both Be and Li belong to the same period i.e., 2nd period. Be and Mg have the same number of outermost electrons, i.e., 2. Hence both Be and Mg belong to the same group in the periodic table.