"My parents are affectionate, yet they do not like visitors."
why does the verb mögen come after doch? Shouldn't it be at the end of the sentence?
This is an example of "verb second idea" rule. Normally in a sentence you start with a subject (he, she, I, you, the house, cat, etc...) and then the verb comes as the second part (/idea) of the sentence.
In German they like to always keep the verb as the second idea. In english we say "Normally I run". This is German is "Normalerweise laufe ich" - "Normally run I".
As you can see above the extra information at the start means that the verb would not be the second idea unless the subject and the verb trade places.
This is something that begins to come naturally after a while.
If I am wrong at all could someone kindly correct me. :)
The syntax of the second sentence is wrong. It should be 'aber sie mögen keine Gäste'. Apart from that, you're good to go. Aber and doch are often interchangable, just like in this case.
I thought sondern was equivalent to aber but only to use when the second sentence contradicts the first one, just like in this case. Isn't that the case?
I think of sondern as "but rather", because it tends to oppose negative statements. It would not be appropriate here because the point is that both statements are true.
One correct solution suggested by Duolingo is: "Meine Eltern sind herzlich, doch mögen sie Gäste", which seems to me to be the exact opposite of the meaning, missing "Nicht" somewhere, isn't it?