Generally in the passive voice.
Use "par" for: When the role of the agent is forceful and for one off actions. Par indicates a dynamism.
Use "de" for: When the role of the agent is less active, mental action, or to indicate a state.
For habitual actions, both can be used.
Here, I think with aimer you're supposed to use "de"
Np! Further clarification - The use of "de" in passive constructions is specific to a number of verbs (appreciation verbs + respecter, connaître, savoir...), with which "de" and "par" are interchangeable. In reality, "de" is more formal and "par" more relaxed (in speech) in such cases. "Il est aimé de sa femme" is indeed more of a state than of an action, but many say "par" with no real difference in intended meaning. But for other verbs, you may not use "de" at all. "la maison a été achetée par XX" is very clear for it is an obvious action verb in both languages. (Credit to Sitesurf)
Good question. I think DL is mistaken in this case. In the passive voice, it's always "aimé de" + agent (similarly with the verbs respecter and connaître) because it expresses a general condition or a state of being. Am I missing something?