Electromagnetic waves are a fundamentally classical concept.
For wave particle duality we need the domain of quantum mechanics.
Consider this wikipedia definition of photon
"The photon is a type of elementary particle. It is the quantum of the electromagnetic field including electromagnetic radiation such as light and radio waves..."
Modern quantum physics has not evolved very far and we still have a lot of concepts to clear but what I interpret from my study is that quantum particles do not behave like particle or wave, they behave in a radically different way which transcends our everyday behaviour of particles or waves so we try to understand them on basis of these behaviours.
Likewise Electromagnetic radiation is not wave or particle as per quantum mechanics but actually neither and you need both these concepts to understand it fully.
So how does EM wave behave like particles?
It is a inherent result of its quantum nature.
What you have shown above is the wave picture of EM wave but it also has a particle picture which is equally valid.
Sometimes it behaves like particles(photoelectric effect and such) sometimes like waves(interference, diffraction ,etc) sometimes any will do(reflection,refraction) but in reality it is neither.
What it is a "quantum particle" and cannot fit perfectly in either pictures so you have to use both of them.
Wikipedia also seems to suggest
"In quantum mechanics, an alternate way of viewing EMR is that it consists of photons, uncharged elementary particles with zero rest mass which are the quanta of the electromagnetic force, responsible for all electromagnetic interactions". (note: "an alternate way" not only way)
Hope this should clear this rather philosophical question!