the second sentence is correct whereas the first one isn't.
"Where" refers to a location, so you could ask "Where are they?" but it always has to be "WHAT are the thinking about?".
- For Teachers