Granted, that little piece of planet Earth that comes with the purchase of your townhouse isn't going to be huge. It's going to be a patch of grass, maybe a shrub or a flowering tree, possibly a petunia border.
Here's where the homeowner's association comes in. You pay dues every month to these folks, and they take care of that patch of grass. And repainting the exterior. And re-shingling the roof. And blowing the leaves out of your parking space. And, if you live in a less than tropical locale, removing the snow in the parking lot.
You can probably plant a row of rose bushes along the front walk if you're so inclined, but no one will look askance if you don't. You need never throw out your back bending over to pull one stupid weed again.
Of course, every HOA (as the homeowners' association likes to call itself) has a different list of maintenance items it'll take care of, so you'll want to make sure you all agree on who has to do what in the yard. But often, the HOA would prefer you keep your flamboyant red hot pokers (calm down, it's a flower) and bright pink window shutters away from the manicured front lawn.