The equation you're using to describe this system is describing the magnitude of the force between the two objects for some given distance - it's not really telling you anything about the orbits necessarily. What you really want to describe the motion of two bodies is some vector equation that also describes an aspect of their orbit. To start to get at this, you'll be considering something called the "two-body problem" (at least what I've heard it called). If you want a full briefing on the entire problem, just give "two body problem" a google and (by my cursory glance) you should find some worked examples of the physics behind it.
If you want a quick answer as to why they follow ellipses you can think of it like this: a circle is really just a special case of an ellipse, so for a general system, the orbital motion is likely to be the most general case (an ellipse).
Note that this doesn't even scratch the surface of orbital mechanics or really explains any of the physics behind it, but for the level of the question you asked I thought it might be satisfying. If you actually want to learn the gritty details and full derivations, an introductory textbook is "Foundations of Astrophysics (Ryden and Peterson)" which should get you started.
Edit: I should mention that in general orbits follow conic sections which could be an ellipse, circle, parabola and hyperbola. These depend on the parameter 'e' called eccentricity, that is a geometric property of conic sections.