You might have noticed when reading through the Gospels that, when it comes to Jesus predicting Peter’s denial, Mark records Jesus telling Peter that he will deny him three times “before the rooster crows twice” (Mark 14:30). Matthew, Luke and John, on the other hand, don’t mention a specific number of crows. They just record Jesus saying that Peter will deny him before the rooster crows, presumably at all (Matthew 26:34; Luke 22:34; John 13:38).
But how did it actually happen? I found myself wondering this after my Bible plan took me through Matthew’s and then Mark’s account. Did Peter deny Jesus three times before the rooster crowed at all, or did the bird get one cock-a-doodle-do out there before Peter’s denials were done? I went looking for answers and here is what I found.
Commentators agree that this way of phrasing the question probably presents a false dilemma. One interpretation is put forward in a way that forces the other to be a contradiction, but, as is so often the case, there may be a third alternative that enables both sides to stand without contradiction and still be as faithful to the text.
Andreas Kostenberger presents the third option to this question in his ESV Study Bible  note on John 13:38:
In a number of manuscripts of Mark’s Gospel, though not all, Mark mentions the rooster crowing “twice” (Mark 14:30, 68, 72), but roosters could crow a number of times separated by a few minutes. Mark specifies the first two individual crowings (as evidently Jesus did), while Matthew, Luke, and John focus on the shameful act of Peter’s denial. They therefore drop this detail and report Jesus as referring to the entire set of crowings as the time the rooster crows.
So the rooster probably crowed many more than two times. Mark mentions that number for some reason, perhaps to remain as faithful as possible to Jesus’ actual words, or to make it clear that Peter denied Jesus at the very end of the night. Or just because he liked detail. I guess the why is less important than the what.
The other Gospel writers communicate the same basic thing, only less specifically. Their use of the word “crow” includes “the entire set of crowings” that a rooster would unleash in the morning. So yes, like Mark records, Peter will deny Jesus before the rooster finishes crowing--but whether it will be long before or sometime in the middle, they don’t really care to say.