This is a Constraint Satisfaction Problem. This problem is also a Zebra Puzzle. A kind of Logic Puzzle.
You can find solutions in multiple languages in Rosetta code.
The rest of this answer is a description of how I figured that out.
The problem in the question reminded me of a "riddle" from a TED-Ed video. I found the TED-Ed video searching in the TED-Ed youtube channel for "riddle thief", which gave me the name "Einstein's riddle".
Looking for "Einstein's riddle" in Wikipedia, leaded me to the article Zebra Puzzle. The article says:
The puzzle is often called Einstein's Puzzle or Einstein's Riddle because it is said to have been invented by Albert Einstein as a boy; it is also sometimes attributed to Lewis Carroll. However, there is no known evidence for Einstein's or Carroll's authorship and the Life International version of the puzzle mentions brands of cigarette, such as Kools, that did not exist during Carroll's lifetime or Einstein's boyhood.
Althought there are no code examples in the article.
There are some interesting links, among which a couple papers talk about Constraint programming:
The name "Constraint Satisfaction Problem" which I'm giving you comes from that last paper. The name "Zebra Puzzle" and the fact that it is a "Logic Puzzle" come from Wikipedia.
I also found the the Rosetta Code link in the Wikipedia article.