what kind of electron determines if a compound is covalent or ionic?