"He keeps the farm" is an invalid translation. No one would ever use this phrase to cummunicate the ideas of maintenance, upkeep, or support. Maybe it fits a literal translation, but duolingo should be avoiding practice phrases that would not be used in real life. "He runs the farm" would be a more natural choice from the options given.
Well, not exactly. You can use the word "mantém" in that sense as well. "Ele vende a casa, mas mantém a fazenda" would mean that he's not selling (i.e., is retaining) the farm.
That being said, there are synonyms of the word for both senses that help resolve ambiguity. If you mean "looks after the farm" you can use "tomar conta de": "Ele toma conta da fazenda". That translates roughly to "He takes care of the farm".
If you mean "retains the farm", the best translation would probably be "ficar com": "Ele fica com a fazenda". "Ficar com" in this context means that the farm will still belong to him. You can also use the direct translation of "retain" which is "reter" - "Ele retém a fazenda" (although it sounds a bit weird).