I imagine most of the city was for business/worship and rich people's homes, but did normal people live there as well? Were apartment style buildings a thing in that time period?
Excellent question! The city of Rome itself provides an excellent, districted example of the workings of an ancient city, so I'll try to focus on that for you, supplemented with some examples from Pompeii. I'd like to do a quick intro to the geography of the city before I start, as well.
Rome has a wide variety of names today, including things like "the eternal city." One of its greatest distinguishing factors, though, was more highlighted in the ancient world, when it was referred to as the "city of seven hills." Irritatingly enough, most maps of the ancient city are too cluttered to really see the hills, but here's a decent one. The seven hills are all inside the Republican walls: the Capitoline, Palatine, Quirinal, Viminal, Aventine, Esquiline, and Caelian. The Tiber River was rather temperamental, overflowing its banks constantly and flooding the low lying areas - the Forum itself (right between the Capitoline and Palatine) was originally a swamp. Pliny the Elder (1st c. AD) describes this here, saying that:
And yet there is no river more circumscribed than it, so close are its banks shut in on either side; but still, no resistance does it offer, although its waters frequently rise with great suddenness, and no part is more liable to be swollen than that which runs through the City itself. In such case, however, the Tiber is rather to be looked upon as pregnant with prophetic warnings to us, and in its increase to be considered more as a promoter of religion than a source of devastation.
(Remember to also take him with a grain of salt - he's a bit of a fanboy when it comes to the city of Rome).
This, of course, separated the desirable land from the undesirable pretty easily. If you wanted to live somewhere that wouldn't flood - and these floods were rather worse than modern flooding, thanks to the filth that would be stirred up - then you wanted to live on the high ground: the hills. Unfortunately, that real estate was in somewhat short supply, and the best spots were quickly taken by the wealthy, who built their homes there. Assuming you're an English speaker, our word for "palace" actually comes from the word "Palatine" - that's where the Emperor's palace complex was constructed, after Augustus literally bought out (or murdered) all of the other rich folks who lived there.
The poor - or even the less rich, such as a young Julius Caesar - lived on the low ground, where disease was rampant thanks to all of the flooding. The urban poor generally lived in tenement-style apartments known as insulae. They were not particularly nice places to live, generally being one room apartments in a 7 story building made of plywood. The buildings themselves were generally owned by the wealthy, who weren't terrifically ethical about the whole thing - they wanted a return on their investments, and the best investment in a time before building codes was to build as cheaply as possible. Crassus once owned half the city through these - and he had a....Machiavellian way about getting more. As Plutarch describes...
For when Sulla took the city and sold the property of those whom he had put to death, considering it and calling it spoil of war, and wishing to defile with his crime as many and as influential men as he could, Crassus was never tired of accepting or of buying it. And besides this, observing how natural and familiar at Rome were such fatalities as the conflagration and collapse of buildings, owing to their being too massive and close together, he proceeded to buy slaves who were architects and builders. Then, when he had over five hundred of these, he would buy houses that were afire, and houses which adjoined those that were afire, and these their owners would let go at a trifling price owing to their fear and uncertainty. In this way the largest part of Rome came into his possession.
(Hint - he was probably just fine with having those fires be "convenient," as it were).
Living conditions in these insulae was just as unpleasant as the buildings themselves. There was no lighting, other than lamps (which often set the whole place on fire), there was no air conditioning (in a swamp), no airflow, especially in the rooms without a window, and often only a single rickety stairway. Collapses were as frequent as fires, and even Cicero, often seen as a paragon of goodness, was one of these slum lords, briefly commenting in one of his letters that a couple of his insulae had randomly collapsed - but the good news was that he could build them even bigger! (Note - no concern for those who were inside when things fell down)
The city was divided into fourteen districts by Augustus, as described by Pliny:
"Surrounding as it does the Seven Hills, the city is divided into fourteen districts, with 265 cross-roads under the guardianship of the Lares. If a straight line is drawn from the mile-column placed at the entrance of the Forum, to each of the gates, which are at present thirty-seven in number (taking care to count only once the twelve double gates, and to omit the seven old ones, which no longer exist), the result will be [taking them altogether], a straight line of twenty miles and 765 paces. But if we draw a straight line from the same mile-column to the very last of the houses, including therein the Prætorian encampment, and follow throughout the line of all the streets, the result will then be something more than seventy miles. Add to these calculations the height of the houses, and then a person may form a fair idea of this city, and will certainly be obliged to admit that there is not a place throughout the whole world that for size can be compared to it."
As with other walled cities, when space ran out inside the wall, people built houses outside of it, and, especially by this time, you can tell how expansive those suburbs (the word itself comes from the Latin "sub + urbs" - or "lesser city") had gotten - though whether or not Pliny's numbers here are strictly accurate is up for discussion. The fourteen districts are described in more detail in the topographical dictionary of Ancient Rome, which is conveniently online for your perusal. Here's a link to some of the other sites within the city proper, one of my favourites being the grain mills. The city itself was home to every business you could imagine, who all generally grouped together for convenience, and many of whom lived where they worked. The most infamous example of these was certainly the dyers, and the stench of that area usually kept most people away - urine was a core component to their work.
Anywho, I've rambled a decent bit here - the TL;DR would be that people of all colours lived in the city itself, and when the city began to overflow, they continued building homes as near to the walls as possible. If you weren't wealthy, you probably just rented out an apartment flat - which definitely wouldn't help out your life expectancy. Hope that helped, and if you have any questions, please feel free to ask!!