To form the DNA molecule, purine bases bind to pyrimidine bases by intermolecular bonds called hydrogen bonds. Hydrogen bonds occur when there is hydrogen near one of these electronegative elements: fluorine, oxygen or nitrogen.
In such conditions, hydrogen looks like having lost electrons for those elements and a very strong polarization is created. The highly positive hydrogen attracts pairs of electrons of other molecules making a hydrogen bond.