Here is a good hint, and I do not think you should be given more.
It is this type of puzzle:
This is not yours, I just found a similar puzzle pic on line. But I would tackle the problem with a grid like this one.
I have not done it, I am just assuming that this would be the right approach.
You put a cross in all the ones that do not work and a tick in the ones that do work until you have averything filled in.
You start by putting a tick in the red house box, which means that you can cross all the other colour houses. etc.
Your teacher probably already told you this much anyway.
Good luck.