Covalent bonds are like two encyclopedias sharing information. They both need a piece of information, so they give each other information. Those pieces of information are in both encyclopedias. To get a covalent bond, replace encyclopedias with atoms, and replace pieces of information with electrons.
For a simple example, lets take H2. A hydrogen atom has one valence electron, and for the shell to be filled, it needs one more electron because the first shell (also called the K shell) needs 2 electrons to be filled. How convenient! If the amount of valence electrons is equal to the amount of electrons needed to fill the shell, we can just make a diatomic molecule. You can visualise two hydrogen nuclei with two electrons in between
In the hydrogen molecule, an electron is with both of the atoms. Just like the encyclopedias, the pieces of information are in both encyclopedias.
Lets give another example: the methane molecule (CH4). This works as so: The four hydrogens are arranged tetrahedrally around the carbon atom, and they all share electrons with the carbon. You can visualise a carbon nucleus with four hydrogen nuclei surrounding the carbon in a tetrahedron, and pairs of electrons between the hydrogens and carbon.
But there is an important rule for covalent bonds to be formed.Both atoms have to be nonmetals! If any of them are metals, they wont form a covalent bond. The reason for this is that metals want to give electrons away, but nonmetals want to take electrons. If one of them was a metal, they would make an ionic bond, which I will write about in my next post.
Now, try to understand the molecule ammonia (NH3). As an extra, try to understand why the shape isn’t completely flat, but a little curved.