Firstly, let's define a covalent bond as being a shared pair of electrons, between two positively charged nuclei, with one being donated from each ion/atom. Let's note that an electron has a negative charge, and the nucleus will have a positive charge (from the protons). Positive and negative charges attract (like when you rub a balloon on your jumper, and it sticks to each other), so the electrons are attracted to the nuclei. When the electrons are in between the nuclei, they are both simultaneously attracted to both nuclei, and the nuclei are both attracted to the electrons, because of their electrostatic charges.
You may also wonder why the electron's don't repel from each other - they do, but the force of attraction between the opposite nucleus tends to be larger. There is another reason, called spin coupling, however you don't need to know that for GCSE. However, if you are interested, I can explain it to you.