No, it should return 2 and 3 if it can have a dog OR a cat but now cow
PS - are you allowed to use a subquery, or is this MySQL, and before the change?
Without subqueries:
SELECT h1.house
FROM animalhouse h1
LEFT JOIN animalhouse h2
ON (h1.animal = 'cat' OR h1.animal='dog')
WHERE
h1.id != h2.id AND h1.house = h2.house
GROUP BY h1.house
HAVING SUM(h2.animal='cow') = 0
;