Top down camera view player on layers or through objects?

Hello, if someone doesn’t mind can they help me with a problem? Okay what I’m trying to achieve using top down source is basically have the camera see my player when he’s behind or underneath an object for example, if I’m in a house with ground floor a basement and attic, how do i get my camera to see me only on those levels or layers and hide everything above or below. I’ve Googled search and found Ben Halliday solution but i can’t for the life of me get it to work. Maybe I’m doing something wrong. Also if I’m behind an object or under an object i should only be able to click what’s on that level or what i can see.
Thank you in advance