Codes stipulate that each drain stack must have a permanently accessible cleanout fitting at its base. (Dry-vent stacks don't need cleanout.) Where you have reduced a 4-inch soil pipe to a 3-inch stack, make the cleanout T-fitting the size of the larger pipe. If the stack is more than 10 feet from the wall, codes require an additional cleanout fitting. You can place this cleanout just inside the wall, in the basement floor, or just outside the house, brought to grade. If you'll be finishing that area of the basement, an exterior cleanout fitting is practical. And, finally, most codes require additional cleanout fittings in above-grade kitchen lines. It makes the most sense to install one after a change of direction in the line.