What did Jesus mean when he said, "You are Peter and on this rock I will build my church." (Matthew 16:18)?
Because of Jesus' teachings and his miracles, there was a lot of speculation about who he was. Some were saying he was John the Baptist, Elijah, Jeremiah or one of the other prophets. When Jesus asked the apostles who they thought he was, Peter replied, "You are the Christ, the Son of the living God." Jesus told Peter that his reply was not based on speculation ("this was not revealed to you by man") but was made known to him by divine revelation by the Father in heaven. The true identity of Jesus had been revealed: He is God the Son. Following this divine revelation, Jesus spoke about building his church. And the connection between what Peter said and what Jesus said about building his church is easy to see.
The mission of Jesus is found in his words, "For the Son of Man came to seek and to save what was lost." Furthermore, he said he came "to give his life as a ransom for many." And Paul says that "Christ Jesus came into the world to save sinners." (Luke 19:10; Matthew 20:28; 1 Timothy 1:15) The mission of Jesus was to save people. When he saves the lost, he is at the same time building his church for the church is the forgiven people of God, the redeemed. The church is not some institution separate and apart from those whom Jesus has redeemed to be his people.
All who would be forgiven confess their faith in Jesus as the Son of the living God and when they are baptised they affirm that they believe Jesus and are trusting him for salvation. (Acts 8:36-38) They compose the church Jesus came to build. And the rock upon which that church is built is that divine revelation made known to Peter by God the Father, namely that "Jesus is the Christ, the Son of the living God." Rock solid!