In a hydrogen atom, the electron and proton do indeed have charges that cancel each other out in terms of their overall effect on the electric field at infinity. However, the electron does not orbit the proton in a classical sense; instead, it exists in a quantum mechanical state described by a wavefunction that spreads out around the proton. The electron's probability of being found at a certain distance from the proton is described by this wavefunction, which is influenced by the electric field of the proton.
When we consider two hydrogen atoms near each other, the behavior of the electrons and protons can be described by the principles of quantum mechanics, which involve concepts like wavefunctions, probability densities, and interactions between particles. The force between the two atoms is not a simple classical electrostatic force because of the quantum nature of the particles involved.
At small distances, the electrons and protons in the two hydrogen atoms will experience a repulsion due to their like charges. This repulsion is mediated by the exchange of virtual photons in the electromagnetic force. The closer the atoms are, the stronger this repulsion will be.
As the distance between the atoms increases, the probability of the electrons in one atom encountering the proton in the other decreases, and the repulsion decreases accordingly. At some distance, the electrons in one atom will no longer be significantly affected by the presence of the other atom's proton, and the force will be very small.
However, the situation is more complex than a simple one-dimensional view of two point charges interacting. The wavefunctions of the electrons will spread out, and the probability of finding an electron at a particular distance from the nucleus is not uniform. This means that the actual force will depend on the specific quantum states of the atoms and the details of their wavefunctions.
To accurately describe the force between two hydrogen atoms as a function of distance, one would need to perform a quantum mechanical calculation that takes into account the wavefunctions of the atoms and the interactions between them. This is typically done using methods from atomic and molecular physics, such as solving the Schrödinger equation for the hydrogen molecule or using perturbation theory to estimate the effects of the distant atom on the wavefunction of the electron in the other atom.