The quantifiers all, both and each are allowed to float: this document explains the rules, however it does not clarify the position for present perfect simple of be: in my opinion if follows the all other verbs rule, namely:
In sentences with other verbs, the [subject] quantifier cannot move over the verb. The restriction against moving across nonfinite verb forms holds for all verbs
In your sentences, both qualifies the subject they, so it must be before the verb been: this is true for sentences 1 and 2. Of these, I would prefer sentence 2.
Sentence 3 is only valid if both qualifies the object. This would be true if they have been something else as well, for example Michael Palin and Graham Chapman trained as doctors and then became actors:
They have been both doctors and actors
be in the present tense is an exception, and all sentences would be valid: note that 1 and 2 convert to the same form in the present tense, as the verb becomes a single word.
I have added an "option zero" as well. In my opinion, sentences 0 and 3 would be better.
0) Both of them are doctors.
1/2) They both are doctors.
3) They are both doctors.