Atoms obtain noble gas valences by gaining or losing electrons.
In a covalent bond the atoms share the electron pair(s) in order to complete each others octet (valence). How many electrons are shared depends on the valence electrons available. Carbon will share 4 electrons and fluorine would only share 1 electron. But 4 F can combine with 1 C to create