The order of layers in After Effects determines the order of how they are rendered. By default, the top-most layer is rendered first. To change this order, you can use the "Render Layers" dialog box.
Select all layers that you want to render in a different order than their appearance in your timeline by holding down "Ctrl" on Windows or "Command" on Mac and clicking each layer.
Choose Render > Render Layers from the menu bar and then click on "Render Selected Layers Last."
You can also select any individual layer and choose to Render > Render Selected Layer Last to render it last without having to select all other layers first.