Stephanus Marcum visitat - Stephanus visits Marcus
Stephanum Marcus visitat - Marcus visits Stephanus
See? It is the cases that determine who does what to whom, etc.
The -us ending here shows who is the subject, the 'doer' of the verb, and the -um shows who is the direct object of the verb. The first is called the nominative case, the other the accusative. More on this in the Tips and Notes.
Otherwise, any word order would work in this sentence, rendering the same meaning.
The word order tells us.
The common pattern, when the verb is not a copula (to be), is SOV. So you have your answer.
When you have a copula, the common pattern is Subject - Verb - Predicate.
So, it also tell us who is the subject, and who is the predicate.
Egs: The thief is a woman, and not The woman is the thief.
No, that's not right. The word order remains very flexible even in those frequent instances where the nominative forms are indistinguishable from the accusative.
But it will always be clear which is the subject and which is the object, thanks to context and common sense, or sometimes thanks to prior experience reading Latin giving you a feel for what is plausible and what is not.
It is actually trickier here on duolingo where we see sentences one at a time without any context. In a really text you should not have a problem -- and if you do, that is a sign that you are reading beyond an appropriate level of difficulty, and that you should look for simpler things to read.