How to create a Torus with a non-circular cross section?
You've already made the profile, you're nearly there..
In Edit mode, drag the profile a little way from its object's origin

(Here, the axis of rotation is going to be Y, it's the profile's Y axis, as well as the world's)
Give the profile a Screw modifier..