First, by process of elimination, we know that the character who speaks the most lines will be a central character, rather than a minor one. So that leaves out even characters like Friar Laurence and Mercutio who both have some pretty long speeches, especially Mercutio whose character is known for his eloquence. That leaves us with either Romeo or Juliet as having the most lines. Their number of lines get awfully close, and Juliet has more and longer soliloquies, including the ones in Act 2, Scene 2; Act 3, Scene 2; and Act 4, Scene 3. Regardless, Romeo has far more smaller lines and appears in far more scenes than Juliet. Therefore, Romeo speaks the most lines, which makes sense considering that Romeo is the tragic hero.
According to Aristotle's commonly accepted definition, a tragic hero is a character who is of high social position, generally a good and noble person, and who also has a fatal flaw that leads to his/her demise. While Juliet, just like Romeo, is the offspring of a Lord, giving her a high social position, it's really Romeo who is characterized as having the greatest fatal flaw, which is his impetuousness and tendency to be guided by his rash, violent, passionate emotions rather than by his rational mind. However, one reason why Juliet may have been given far more and longer soliloquies than Romeo is because, as the girl of the couple as well as the youngest, Shakespeare wants to characterize her as exploring her sexuality and growing into a woman. Romeo already knows where his sexual desires stand, hence he was given the long opening soliloquy of the balcony scene in which he metaphorically tells Juliet in his imagination to cast off her clothes or her virginity in the lines, "[The moon's] vestal[virginal] livery[clothing or uniform] is but sick and green, / And none but fools do wear it. Cast it off" (II.ii.8-9). In contrast, Juliet is given even longer soliloquies in which she speaks of her sexual attraction to Romeo, waits in longing for his arrival on their wedding night, and even expresses maidenly apprehension, as we see in such lines as:
Come, civil night,
Hood my unmann'd blood, bating in my cheeks,
With thy black mantle till strange love, grown bold,
Think true love acted simple modesty. (III.ii.11-17)
In these lines, she is personifying nighttime and asking it to come and cover her in darkness to hide her maidenly blushes until she becomes more bold in her lovemaking.
Hence, even though Juliet has more and longer soliloquies, Romeo speaks the most lines overall because he is the play's tragic hero.