loin in French generally indicates distance or the sense of "far away". The most common I hear it used is when someone is saying that one thing is far away from another or asking if one thing is far away from another.
C'est loin d'ici? (Literal translation: It is far from here?) (Proper translation: Is it far away?)
Let's work through your two phrases.
au loin does usually indicate distance in the direction away from the subject or the speaker. I tend to think of it in English as
to the far away, which is a very literal use that helps me get by with such things when I learn languages. That being said, it can better be translated as
in the distance.
In your example:
Au loin on voit un grand pavillon.
The sentences indicates that there is a large pavillion visible in the distance. Without more context, I can't tell whether or not the subject is a group of people or it is being used in the sense of
de loin can have two meanings. The first indicates distance in the direction toward the subject or speaker. I tend to think of it in English as
from the far away but again, that's a very literal translation that serves my method of thinking. It is better translated as
from a distance.
De loin, il semble beau. (Translation: From a distance, he seems beautiful.)
The second meaning of
de loin: This does not have to do with distance in relation to a speaker, but is more expressive as an adverb in the sense of
vraiment. It can be translated as
by far or
by a long way.
Je suis de plus le plus intelligent. (Translation: I am by far the most intelligent.)
There is a word missing in your sentence, but I tend to think your example:
De loin n'entend pas ce qu'il dit.
is probably meant to be written like this:
De loin, on n'entend pas ce qu'il dit.
Which would roughly mean that from a distance, what he is saying is not heard or literally translated:
From far away, one does not hear what he says.
His words can't be heard from a distance.
So, it seems to me that your example involving
de loin uses the first meaning I mentioned.
You can find more on the word here along with other usages.