Hello! There aren't firm rules for where you put the agent (the "doer" or person who does the action) in a passive voice sentence.
However, because "by" can also be a preposition of place or method/manner (Examples: "I put my keys by the door." or "I broke the vase by dropping it."), the agent can sometimes be unclear if you put it too far away from the passive verb. My suggestion is if the part of the sentence after the agent is long, you put the agent ("by ....") immediately after the verb, where it is clearest.
So example number two could be a little clearer if you wrote it this way:
2) The cabbages aren't grown BY THEM in front of the house.
"by them" could mean "next to them" based on the context of the previous sentence. For example, the sentence:
"We have several flower beds in the front yard. The cabbages aren't grown in front of the house by them"
could mean mean that the cabbages aren't grown next to the flower beds, which isn't the meaning that you are trying to communicate.
The Bottom Line: if you want to be totally clear, put the agent immediately after the passive verb.