So to sum it up and to skip a bunch of dynasties and capitals that are no fun for the purposes of this summary, there was the capital of Ji (not of a unified China, just of Yan).
Then there was a Lower Capital, because it was "below" Ji.
Much later Yuan renamed Ji to Middle Capital because it was between Lower Capital and a new (secondary) Upper Capital.
Next up, Ming had a capital, but moved to old Ji again, and now it was North Capital because it was north of the old one. And the old one was renamed South Capital (Nánjīng) because it was south of the new one.