How do I make an object rotate in an axis around another moving object?

How close is the effect you’re after to the animation in this unrelated post: