こんにちは!
ご質問ありがとうございます。
ご質問について、いくつか言い方が考えられますが、例えば、
They have the same last name.
とすると、「[同姓](https://eikaiwa.dmm.com/uknow/questions/128665/)です。」となります。
役に立ちそうな単語とフレーズ
the same last name 同姓
the same surname 同姓
the same name 同姓同名の場合にも使われることがある
参考になれば幸いです。