The way I do those is to leave the lengths a bit long, and do the mitered corners first. I get a good fit, and then cut the lengths. If the moulding goes the whole perimeter, I check all four corners for a good miter fit.
Then, I glue the edge, and set the two for a corner to get a good miter fit, and use a brad nail about an inch or more from the end, and pin it on. Then I feel the top edge for a flush fit (or very slightly high), and put a few more brads in. Then go to the next piece to that miter, and fit it tight, and pin it on the edge...again away from the corner. I don't pin the miters together. There is the possibility of splitting. Since there is glue on the fitted mated edges, that holds them.
After going around all the edges, and the glue gets cleaned up if there is any squeeze out, I use a scraper on the top edge to get it even with the top, and sand the profile to get it smooth.
.