How do i set a object with particles to the background and keep another object in front in composition? Hello guys iv got a sphere that has particles (stars) and im putting some blur on them how do i set that image as a background? and keep the ship in front of it ?

the particle system is connected to the sphere the ship is inside of it and the camera is too. the particle system is on another layer. im rendering them separately and in the compositor view adding blur to the stars. 
the ship is not a single object.
id like the stars not to be visible in front  of the ship. as seen in the render view (bottom left) 

And my plans are going around the ship with the camera.
Assuming your rendered image has an Alpha channel then simply change the last Add node in the chain to ‘Mix’ and use the Alpha as the Fac. This will mix between your shapceship and the stars based on the alpha.

Note that if you don’t have an alpha (if you haven’t rendered with transparancy enabled) then you can use the Depth as a filter instead as it will be very high for points on the background behind your spaceship (1000000000 or similar - effectively ‘infinity’) and much lower for points on it - pass the Depth through a Greater Than maths node to compare it with, say, 10000000 and the output of that can be used effectively as an alpha.



This resulted in a final solution (from @IvanVujacic) as follows :