As the other educator post states, Tom Stoppard’s absurdist play follows the minor Hamlet characters that Claudius employs in hopes of having Hamlet executed on a trip to England.
Because of their limited role within Shakespeare’s original play, most of the action involving them in Stoppard’s play occurs while the two men are “offstage.” Since they are offstage for the majority of Hamlet, Rosencrantz and Guildenstern are isolated for much of the story.
This is why the play is often categorized as an absurdist text. Stoppard inverts conventions by having the main character become a minor one, and much of the “action” of the play is uneventful. Furthermore, the title characters are relatively oblivious to what is happening “onstage,” which is played to humorous effect. Rosencrantz and Guildenstern, despite being the protagonists of their own story, don't really function in ways that traditional main characters do.