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:
Luke 7:1 When He had completed all His discourse in the hearing of the people, He went to Capernaum.
Luke 7:2 And a centurion’s slave, who was highly regarded by him, was sick and about to die.
Luke 7:3 When he heard about Jesus, he sent some Jewish elders asking Him to come and save the life of his slave.
Luke 7:4 When they came to Jesus, they earnestly implored Him, saying, “He is worthy for You to grant this to him;
Luke 7:5 for he loves our nation and it was he who built us our synagogue.”
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.