An AR-15 lower will shoot both the 9mm and the .223/5.56mm round.
You will need two different types of magazines. One for each round.
You will need at least one upper, but you will need two barrels, one for each round, along with the bolt carrier group for at least one round that you can switch back and forth. I think you also need a hammer for each unit, but I can't remember for sure and it's late, sorry.
However, you may need to fine tune your buffer and buffer spring for the difference in the power of the cartridges.
The easiest way is to have one fine tuned lower and have two uppers:
(1) dedicated to shooting .223/5.56mm rounds
(1) dedicated to shooting 9mm rounds
Then you change two pins and you are set to go to the races, baring the same hammer can work for both rounds.