Your city needs to have a fort first, troops don't garrison cities themselves. The troops then auto garrison the fort unless they are selected then you can click the province and they will be outside but will go back to garrison if you deselect the province and they have not been ordered to move.