When two H atoms come closer the following forces operate between them:
a. Attractive :
i.nucleus of atom and its electron
ii.nucleus of one atom and electron of other.
b.repulsive :
i.electrons of two atoms.
ii.nucleus of two atoms.
It has been found experimentally that magnitude of attractive forces is more than repulsive forces hence two atoms come closer to each other and the potential energy of the system decreases. A stage is reached when attractive forces balance repulsive forces and the system acquires minimum energy .At this stage two hydrogen atoms are said to be bonded together.