How would you tell the difference between a good and poor nucleophile from the molecular formula?
We would do so by experiment.
Our notions of nucleophilicity or electrophilicity rely purely on experimental result. Hydroxides or amines are deemed to be good nucleophiles PRECISELY on the basis of their propensity to be active in nucleophilic substitutions.
Of course, when we consider the chemistry of good nucleophiles, we might note the presence of negative charges or lone pairs electron pairs (or both) and might reasonably conclude that such electron pairs are involved in the formation of new bonds.