It would be easier to answer if your question was a bit more clear. Anyways, here are few things.
Chemicals attracting soil bacteria to roots or nodules:
Most of these are sugars present in root exudates.
Chemicals that attract Rhizobium to the legume rrots to form nodules:
There are many compounds, one of which is flavonoids produced and sent out by legume plant roots
Nodulation and nitrogen metabolism has been a field where very detailed studies have been carried out. So it is very easy and clear now to understand it, provided access to good publications. All the best.
I thought that the type of chemicals may vary in diffferent legume plant species. Because each legume plant species has its own particular Rhizobium strain. For exampleLipido-chitin-oligo saccharide chemical may attract in one strain not others.