It appears he became a suspect in the McCann case in 2017, that was when he made a confession in the bar, which I guess was soon after reported to police. At that time, he was likely in Germany, and a free man. So, German police would have at that point been asked to investigate him.
Subsequently, he's been arrested and prosecuted for the rape case in 2006. I suspect that, in questioning his former associates in Portugual, the issue of the rape incident emerge, his DNA was tested and matched to that case. German police arrested him, but, IMO, would not want to send him to Portugual for trial, in case he was acquitted, released, and disappeared.
So, my suspicion is, he is in Germany because he's suspected of Maddie's murder, and no one trusts Portugual police or courts any more. JMO