The force that controls the motions of the atomic electrons is the electromagnetic force. To bind the nucleus together, however, there must be a strong attractive nuclear force of a totally different kind, strong enough to overcome the repulsive force of the positively charged nuclear protons and to bind both protons and neutrons into the tiny nuclear volume. The nuclear force must also be of short range because its influence does not extend very far beyond the nuclear "surface." The nuclear force is due to a strong force that binds quarks together to form neutrons and protons.
The attractive force that binds the progressively growing galaxy together is the gravitational force. It's the force that not only holds you to the Earth but also reaches out across the vastness of intergalactic space. Although no two particles are every truly isolated, the following equation expresses the gravitational force between two objects of mass m1 and m2:
(Newton's law of gravitation)
where G (the gravitational constant) = 6.67 X 10-11 Nm2/kg2 and r is the distance between the two objects.
Two electrons exert repellent electromagnetic forces on each other. At a deeper level, this interaction is described by a highly successful theory called quantum electrodynamics. From this point of view we say that each electron detects the presence of the other by exchanging virtual photons with it, the photon being the quantum of the electromagnetic field.
The weak force is a short-range force which is responsible for accounting for beta decay within the nucleus. The role of the weak interaction seems to be confined to causing beta decays in nuclei whose neutron/proton ratios are not appropriate for stability.
The theory of the strong force, that is, the force that acts between quarks, has also been developed. They are nuclear forces which are repulsive at very short range as well as being attractive at greater nucleon-nucleon distances. This keeps the nucleons in the nucleus packed together but not meshed together. There's no easy way to describe the theory behind this theory also known as the Meson theory of nuclear forces. For more information, consult this source.