Non-Metals generally have weak intermolecular forces of attraction (Van der Waals forces) between simple molecules, except for C, Si and B which form a covalent network and are held together by very strong covalent bonds.
Going across period 3 melting point generally decreases, except for sulphur and phosphorus being the other way around. This is due to sulfur forming a molecule with 8 atoms, phosphorus with 4, chlorine forms a diatomic molecule and argon a monoatomic molecule. Therefore even though as you go across the group electrons increase, sulfur has the highest melting point as it has 128 electrons to argons monoatomic 18. More electrons, more london dispersion forces the higher the melting point.
Going down the group as electron shells increase the added electrons increase the strength of London dispersion forces, increasing melting point.
Some non-metals have permanent-dipole permanent-dipole forces, (as well as LDF), between the molecules due to their difference in electronegativities, increasing their melting point.
Nitrogen, oxygen and fluorine form hydrogen bonds due to their large difference in electronegativity with hydrogen, increasing their melting points further.