Peter was at a crossroads - if he remained far from Jesus he would be safe, but not live up to the promises he'd made earlier, if he stood by Jesus he would live up to his promises but could lose his life... he didn't know what to do. he tried to strike a balance... and folowed him at a distance.. Peter loved Jesus.
Peter wanted to prove to Jesus that Jesus' initial prediction was wrong, and that Peter wouldn't deny Christ. -
John knew Annas - so he was able to get in... he was well known to the people, but John left Peter in the courtyard and went to the hall where Jesus was being tried... this left Peter alone with the enemies of Jesus who were gathered around a small fire... Peter didn't want to be recognized.
A young servant girl was staring at him intently... she wanted to see if Peter was who she thought he was, a follower of Jesus. She knew that John was a follower, so maybe this man was also. She must have wanted to look important - she wanted to let the men know she knew something that they didn't. - She blurted out to Peter "You aren't not one of His disciples are you?" he answered "I am not.""
-- Peter was a large man, who did a little girl become such a big threat... Peter must have been eyeing the soldiers all around though, looking at any kind of hint that they recognized him...
One of the high priests servants, challenged him, (this was a relative of the man whose ear that Peter had chopped off earlier...)she asked him "did I see you with him in the olive grove? - Again, Peter denied it. - at that moment a rooster began to crow (John 18:26-27"
With his identity revealed Peter couldn't sit there any longer... he got up and stood near the edge of the courtyard, in case he needed to escape. another servant girl pointed him out to the crowd. This girl didn't ask a question, she spoke with certainty and conviction.
71 Then he went out to the gateway, where another servant girl saw him and said to the people there, “This fellow was with Jesus of Nazareth.”
She may have been in the garden when Jesus was arrested, we dont know, but she knew that this was the man who'd tried to kill her relative, and she could speak as an eyewitness of his true identity.
Peter's worst fears were coming to reality- The soldier's stares were cold and threatening, he was in danger of arrest and death, Peter lashed out in defense, he denied any involvement with Christ, this time with an oat "I don't know the man!" (Matt. 26:72) Its said that when a Jew took an oath, even when not using God's name explicitly, person was calling God as witness to the truth of their statement. by this act, Peter was insulting God, for as the Bible says, "It is impossible for God to lie " (Heb. 6:18)
The 3rd denial:
59 About an hour later another asserted, “Certainly this fellow was with him, for he is a Galilean.”
60 Peter replied, “Man, I don’t know what you’re talking about!” Just as he was speaking, the rooster crowed. 61 The Lord turned and looked straight at Peter. Then Peter remembered the word the Lord had spoken to him: “Before the rooster crows today, you will disown me three times.” 62 And he went outside and wept bitterly.
We don't know why Peter didn't leave the courtyard after the 2nd denial but he stayed there in that place of temptation for another hour. Perhaps it was a real but weakened love for Christ, perhaps his curiosity demanded he see the turn of events, most likely satan himself tempted him to linger.. - when he should have fled... But whatever the reason, Peter stayed there...
Peter out of nervousness began to talk with people around him, and that is what sealed it all, people in Jerusalem could easily recognize the accent of a Galilean, which they despised...
The people in the courtyard were convinced that Peter was a disciple of Christ, and they knew that Jesus and his disciples were from Galilee...
Matt 26: 73 After a little while, those standing there went up to Peter and said, “Surely you are one of them; your accent gives you away.”
Peter felt trapped, there it was, it all was there... he upped the intensity of this denials...
71 He began to call down curses, and he swore to them, “I don’t know this man you’re talking about.”
In the middle of Peters 3rd and most vehement denial a rooster crowed, calling the dawn and calling Peter to repent. Gods timing was at play.
When the rooster cried, he immediately remembered Jesus's words,"before the rooster crows today, you will disown me three times" (Luke 22:61)
At this same moment Peter looked up and saw Jesus standing in front of im looking intently into his eyes--
"The Lord turned and looked straight at Peter" (Luke 22:61)
Peter didn't notice what was going on around him, he didnt see Jesus being led his way. The Temple police were leading him from the hall of trial through the courtyard to some place of detention until he was to be wanted again. His face was black and blue from all the blows he had received.
We can only imagine what was going through Peters mind during this time - as he caught the look from Jesus, a look that Peter only would understand, not in disgust.... ' you have hurt me, more than my enemies ever could, I rebuke you for your lying and I heard your denials, but I have not forgotten you, I still love you.
It was then when we are told " And he went outside and wept bitterly" (Luke 22:62)
We don't know where Peter went but he was aware of his sin and he repented.