According to this GameFaqs strategy guide, the following works for maintaining a good relationship with the Pope:
"Doing missions for the Pope, not fighting other Catholics, and giving the Pope
large sums of money are good ways to maintain a healthy relationship with him."
The strategy guide also mentions assassinating the Pope to try to get someone more favorable to you to be the Pope and bribery for when you get excommunicated.
First of all, you have to make sure that you keep all of your citizens happy so that you can tax them to death. Generals, town halls, churches, and farms are good ways to do this.
After that, build ports, markets, farms, and mines in all of your cities, and consider converting some castles that are well protected into cities, since castles are best at making soldiers, not florins.
Since ports are your main money makers, trade agreements come in handy, as does having lots of cities. Make sure not to let your docks get blockaded either.
If you need lots of money quickly though, there are a couple ways of doing it. You can try to sell off some reserve military, but that's not the best option, since you never know when you'll get attacked someplace that you never thought that you would, and since you don't get a lot for troops.
My favorite way is to just go on a crusade/jihad with my main army that's closest to the people of a different religion. All the troops in that army get free upkeep, and I can hire dirt-cheap mercenaries while conquering new cities and keeping the pope happy.
Another way that works well when used with crusades is to just loot random cities. Conquer a relatively undefended city that you know that you'll never be able to keep, loot it, sell all the buildings, and march all of your troops out and on to their next target. You'll usually get 30,000 florins, and your enemy's city gets reduced to almost nothing.
Best Answer
You garrison troops by simply moving them into a settlement. It depends on the unit for free upkeep whether it can produce them. Castles cannot do it for free.