How are these Airbus A350s flying in formation without being affected by wake turbulence?
You are right that wake turbulence would be a danger when flying behind another aircraft like that.

The perspective of the photo makes it hard to see the actual position of the trailing aircraft relative to the ones in front of it. Pilots do this sort of thing in airshows when they fly in formation. The trailing aircraft are generally slightly below the ones in front of it. This allows good visibility of the plane they are following. At the higher speeds that these jets are flying at, the wake vortex will not drop enough to impact an aircraft fairly close behind and below.

See this old photo of the Thunderbirds. From this perspective, it is easier to see that the trailing aircraft is also below the flight path of the leading aircraft.