A passport is citizenship for the issuing country.A passport is nothing but citizenship given by the issuing country.
HereIn your case, Country A is the issuing country. Being in country B when you renewed your passport does not make you citizen of Country B.
Passport issue/renewal is a very complicated process. In your case Country B is not involved in any of the process of verifying any of your documents, or legality. However the place of issue is Country B/ whatever the city.
So in your case, Country A issued/renewed the passport while you were in country B, so your country of issue is Country A, and place of issue is Country B/whatever the city.