I couldn't see exactly how the probe itself can differentiate, but my molecular science knowledge is approximately non-existent. I think it does it by imaging the photons of the infected tissues (lit up by the fluorescent spray) and sending images up to a screen. Photons are the tiniest elements making up the molecules, and the device can show them so that an operator can presumably tell quickly exactly which bacterium is causing the disease and prescribe the appropriate antibiotic. Much time is wasted taking samples and having them painstakingly cultured in the lab and then identified.
The "Technology" button on the Proteus website leads to more details on several aspects of their research and "In the clinic" describes the molecular imaging. proteus.ac.uk/clinical/molecular-imaging/