Matthew 5:41 - The Greek text reads: καὶ ὅστις σε ἀγγαρεύσει μίλιον ἕν, ὕπαγε μετ’ αὐτοῦ δύο.
ἀγγαρεύσει” (angareusei) translated as “compels” or “forces,” alone obviously does not specify whether the person is a soldier or a layman. That being said, the context of the verse is that it could be anyone who has the authority or ability to compel another person to go a certain distance.
The original Greek does not mention a soldier. Instead, it uses "ὅστις" (hostis) meaning "whoever." So, clearly the text uses a more general term that could apply to any individual with such authority. However, who would have such authority?
compel thee to go one mile in A. V[32] and R. V[33] Hatch (Essays in Biblical Greek, p. 37) thinks it means compel thee to carry his baggage, a very probable rendering in view of the history of the word as he gives it.
A Persian word, originally, introduced into the Greek,
Latin, and Rabbinic languages, it denoted first to requisition men,
beasts, or conveyances for the courier system described in Herod. (Expositor's Greek Testament)
If it refers to a soldier, the idea likely comes from the historical context of Roman occupation. Roman soldiers had the legal right to compel civilians to carry their gear for a mile. This was known as “angaria”. So, this might have influenced some translators to specify “soldier” in order to grasp the historical context more accurately.
next in post-classical use under the successors of the Persians in
the East, and under the Roman Empire, it was applied to the forced
transport of military baggage by the inhabitants of a country through
which troops were passing. Hatch remarks: “The extent to which this
system prevailed is seen in the elaborate provisions of the later
Roman law: angariae came to be one of those modes of taxing property
which, under the vicious system of the empire, ruined both individuals
and communities”. (Expositor's Greek Testament)
We see an example of this elsewhere in scripture as well:
An instance in N. T. of the use of the word in this later sense occurs
in Matthew 27:32, Mark 15:21, in reference to Simon compelled to carry Christ’s cross.
We may conceive the compulsion in the present case to
proceed from a military man.—μίλιον, a Roman mile, about 1600 yards, a
late word.—δύο, in point of time, the additional mile = two, there and
back, with proportional fatigue, a decided climax of hardship. (Expositor's Greek Testament)
To conclude, the text does not specify whether it is a soldier or a layman, but the historical context suggests that it could be referring to a soldier.