This is a nodegroup to replace (to an extent), the built in DOF node in the compositor. I have NEVER been able to create a DOF effect with it that let foreground objects blur over background ones, but this baby does it in 10 layers!
It breaks up the shot with the depth map and blurs progressively based on where the focal point is placed. VERY cool!
It also sports a slider to help compensate for outlines that extend a bit beyond the boundaries of the object itself. Off by default.
Follow the tool tips in the controls themselves and you will have no problem using it! For more info on how this method works, check out this tutorial that covers a 2 layer version: http://www.pantherdynamics.yolasite.com/panther-dynamics-blog/for-anime-defocus
CAUTION: This nodegroup does require some resolution in order to function properly. The lower the resolution, the more error prone it becomes. I strongly caution to use FullHD as your minimum resolution with this, but now lower 50% HD. Just try it at a low res and see why I say so, lol.
As always, use at own risk!
(Render engine doesn't matter here, but I did use EEVEE for the demo scene - included)