Hiding part of the object im trying to hide part of my object(B) on render. Hidden part is defined by other object(A) that covers it on camera view(z axis). Is there any good solution for that? Thanks!
Give object A an Holdout material.

That will only work if "Transparent" is enabled in Render Properties/Film, so in case you want a solid background, you'll need to add it in compositing.