The camera setting is called multiple exposure
It’s not available on all DSLR’s so check your user guide to make sure that it is in fact available on your camera.
This setting takes several images then combines them in camera into one image. It looks like somebody created the image in Photoshop but using multiple images of multiple layers at varying degrees of opacity.
The video below discusses the ins and outs and possible uses of multiple exposure. There is another video on the next page that shows how it’s done both in camera and in Photoshop