At the crucifixion, there was a centurion who realised that Jesus must be the Son of God (Matthew 27:54). Was this the same centurion from Luke 7 who had faith Jesus could heal his servant with just a word?
It is highly unlikely (if not impossible) for the centurion at the cross to be the same man in Luke 7. The centurion at the cross was stationed in Jerusalem, while the centurion in Luke 7 was stationed in Capernaum:
Altogether, Rome had several tens of thousands of centurions stationed in Judea, so there is no reason to assume that the same man was involved in these two different moments which took place many miles apart. Instead, we understand that two different centurions (and probably many more) came to faith in Jesus as Messiah during His ministry on earth.