This is actually simple, but it just takes time. While in a race you can choose to go on a ramp that is slanted. Go on the ramp and when you launch off it your car should perform a barrel roll. My car usually performed two barrel rolls most of the time