I got a clue from the comments of Anon.
A bond is present when the distance between two atoms is lower than the sum of the Van der Waals radii of the two atoms.
Van der Waals radii are typically looked up from a preexisting table, not calculated. We can find such tables in chemical reference books or online.
For instance, here is a link that supplies the following Van der Waals radii table:
Please note that
MD simulation software like Amber, NAMD, GROMACS, etc. use parameter-topology files to supply such information.
These files are the results of long-term experimentation and testing for decades.
Therefore, it is not a good idea for the new/learner/beginner/hobby MD simulation software developers to try to compute bond information themselves.