How to make outline material like this?

I’m trying to make a material like this but all info I can find about outline materials gives the same effect than the UE editor selection effect without an outline around the mesh but not on every all edges of the mesh. Can someone help me?

Box