You need to experiment and it will become obvious.
Every forest/water around the workers house boost production by boosting happiness which boost walk speed by a fair bit. The difference between 3 forest/water and 2 forest/water is noticeable. Being next to the same type of house has less impact but is better then being next to nothing. For example in the offered game screenshot above, judging from the screenshot and the general pwn of that game, I would guess he had the +1 happiness wonder which helps layout flexibility a lot. For example, the home next to the above palace only has the house of the same type to make him happy, which ordinarily would not make him as happy as he is. But its possible to get that happy without that wonder just by being careful.
In the end, I guess the message is instead of just looking at production watch peoples happiness when evaluating their work and evaluating your work.
The best layouts juggle walking distance and access to happiness. To make that a bit more complicated there is assymetric distance in that walking to a granary with a load is slower then walking home and to work without one (so granary closer to work then the house is generally better if you have to chose). Unlike the real civ there is no magic bullet formula to tell you. It is a puzzle problem, and one a computer could only solve with an exhaustive search. Like all puzzle problems imagination and experimentation can help quite a bit.