Suppose we have 4 hydrogen atoms and 2 oxygen atoms. If we write the Hamiltonian containing all the possible interactions for the Schrodinger equation, how can we distinguish the system is two interacting water molecules or 2 hydrogen and an oxygen molecule?
One way to do so would be by looking at spatial correlations for each pair of atoms. If the positions of hydrogen and oxygen atoms are often correlated, then you likely have water; in contrast, if there is little or no correlation between hydrogen and oxygen atoms, then you either have separate molecules of hydrogen and oxygen or you have a bunch of isolated atoms. To distinguish between the latter two cases, look at correlations between the positions of oxygen atoms and the positions of other oxygen atoms (and likewise for hydrogen atoms). If a high degree of correlation exists in the positions of particular pairs of oxygen atoms, it's likely that those oxygen atoms are in an oxygen molecule (and likewise for hydrogen atoms). If not, then that particular pair have not formed a molecule.
I would argue that a quantum mechanical system is defined by its Hamiltonian and the underlying Hilbert space. Therefore, two systems which exist in the same Hilbert space and which have the same Hamiltonian are, by definition, the same system.
Case in point, your example. The configurations you speak of (two H$_2$O molecules vs. two $H_2$ molecules and one $O_2$ molecule) are in fact two separate states$^\dagger$ lying in the same (extremely complicated) Hilbert space.
$^\dagger$Of course these are not individual states, but large collections of similar states which are identified with each other by virtue of the bond structure which exists between different atoms. For example, two atoms can be considered to be bonded together if one or more of their valence electrons exist in bonding orbitals - see here for more.