Floor trim, which is also known as floor moulding, sits at the joint where the floor meets the wall, dressing up the border and tying it into the door and window trim in the room. There are different types of trim and different methods for cutting it, a basic mitre design being the most common. Make sure to get spans of trim that are longer than each of your walls, so you don't have to splice pieces together along the straight spans.
Select a length of floor trim longer than the first wall. Stand the trim on a mitre saw, against the rail, in the same position in which you will place it on the wall. Set it so one end is in front of the blade.
Swivel the blade to 45 degrees inward, so that it points toward the middle of the span of trim. Cut.
Measure the wall, from the starting corner outward.
Transfer the measurement to the back of the piece of trim, starting at the point of the cut you just made. Mark the trim for the cut along the top of it.
Position the mark in front of the blade. Swivel the blade 45 degrees inward, in the opposite direction as before. Cut.
Cut the pieces for the other walls in the same way. Use your hammer and trim nails to affix them to the wall along the floor, with the angled ends butting up against each other to form the corners.
For outside corners that jut into the room, follow the same process, except make the cuts angle outward instead of inward.