Imaginative quiet teenager Rafe Katchadorian is tired of his middle school’s obsession with the rules at the expense of any and all creativity. Desperate to shake things up, Rafe and his best friends have come up with a plan: break every single rule in the school and let the students run wild.
We open with Rafael 'Rafe' Khatchadorian (Griffin Gluck) drawing in his sketchbook. In his mind, the drawings come to life and blast his alarm clock when it goes off. His mom Jules, (Lauren Graham) enters and comments that Rafe's been drawing all night, though he denies it.They have a talk about how its hard starting a new school life in the middle of a semester and that this is the last school that will take him. She gives Rafe a lunch that is somewhat unusual telling him that sometimes he needs to think outside the box. At this point, Rafe's younger sister Georgia, (Alexa Nisenson) comes around the corner driving the family minivan, much to Jules annoyance. As they pull up to the school, Jules gets out to hug Rafe and to tell him and Georgia that shes working a double shift as a sous chef and that Carl (Rob Riggle), will be picking them up, much to the complaints of Rafe and Georgia, despite her claims that hes been there for her during a difficult time.Rafe walks to the school and meets Principal Dwight (Andy Daly), who berates Rafe for violating several school rules, despite him being new and not knowing any of them. Rules include things like the design on his shirt and his headphones. As Dwight does so, Rafe's best friend Leo (Thomas Barbusca) mocks him behind his back. Dwight gives Rafe a copy of the school handbook for him to memorize. Rafe enters the school, and we see that it is a strict and depressing place, with the students walking in slow moving straight lines and no art or any real color in the hallways. Rafe and Leo meet in the middle and comment about how crazy the school is and that, once again, this is the last school that would take either of them. As they converse, Vice Principal Stricker (Retta) comes out to berate Rafe for standing in the halls and disrupting the flow of traffic. Rafe enters into a classroom and meets his teacher Mr. Teller (Adam Pally) who is much more relaxed and fun loving, commenting that unlike the Principal, Rafe doesn't need to call him sir. He teaches the kids using rap references, and they laugh and learn from him. Rafe sits in front of Miller (Jacob Hopkins), the school bully that kicks Rafe's chair whenever he sits down, purposefully mispronounces his name, and threatens him. The class leaves for an assembly for Student Council president.Jeanne (Isabela Moner) one of the candidates, comments on how we need to change the school to include things like art again but is cut off by Dwight before she can finish. As she leaves, Rafe is the only one who gets up to clap for her. The principal that goes on about a test called the B.L.A.A.R. giving Rafe a cartoon idea with the principal as a zombie. As he is drawing, however, a girl takes the book out of Rafe's hands and comments on how awesome it is and passes it forward, despite Rafe's protest. It is confiscated by Sticker and Rafe is sent to Dwight's office. He is reprimanded for his actions and Dwight comments about how the school itself is his child and not the students in it. He has the janitor Gus (Efren Ramirez) bring a bucket of acid and, no matter how much Rafe protests, throws the book into the bucket. We see Rafe's creations, including the one from this morning die. At the end of the school day, Leo tries to cheer up Rafe, commenting on how he made a whole world in that book, even an alien species with their own battle cry, he asks if he opened the thing he got him, to which Rafe replies that he hasn't. Carl picks Rafe up in a sportscar, despite not having any idea how to drive it. Carl is called Bear by Georgia, much to his annoyance, who cares about his car and its value more than he does the kids.Rafe enters his room, and Leo knocks on the window. He climbs in, and Rafe opens the package, though Leo tells him not to open the card as it will get all emotional. Inside is a brand new sketchbook to Rafe's delight. Rafe and Leo talk more about what happened to him at school. Leo gets the idea to go after the school itself and break the rules in big ways, and Rafe reluctantly agrees after some convincing. Rafe sneaks in through the first-floor window while Jules is preparing breakfast the next morning. She doesnt notice him come in and is surprised to see him already up and dressed, with Rafe commenting that he is merely excited to get to school. When he walks away, sticky notes are on his back. In school, Dwights entire office is covered in sticky notes with the janitor commenting that whoever did this was committed to their art. Sticker goes around the school and sees that the hallways are completely covered in them, arranged to look like art, including a mosaic of Sticker herself, though she fails to notice it. At the end of the hall, a wall is covered with a sign that says rules arent for everyone.Carl takes Rafe and Georgia to Dave and Busters for dinner, with Carl mocking Georgia with his car toy, despite the fact that she actually won it and he merely took it from her, though he reasons that since its his money, he won it. Carl wants to leave, but Georgia protests due to not having dessert yet. Carl tries to flirt with a waitress when she comes over, much to the shock of Georgia as he tries to seem like a good guy by getting dessert. Carl defends his actions, by saying that he is the reason their mom is so happy right now. Rafe is drawing Carl as an actual bear, but Carl uses it and leaves it on top of his credit card. The drawing comes to life, and a cartoon sequence of slapstick is shown. Back in his room, Leo and Rafe notice the credit card left an imprint and they use it to fund their pranks further. They sneak into the school and hook up the bell to a have a fart sound after it finishes. The pranks continue with things like hair dye turning Dwight's hair pink, and Sticker opening the door to be overwhelmed by a closet full of playpen balls.Rafe and Jeanne grow closer to each other, and she admires the pranks because someone is fighting against the establishment. He agrees to help her with one of her volunteer clubs after a passionate speech about the environment. Rafe is about to tell her he is the prankster but Leo stops him from doing so. In Tellers class, Rafe impresses him with his drawing and goes to talk to him asking about why such a talented guy is in this school. Rafe explains that its been rough for him since his younger brother died a year ago from cancer. Teller tries to comfort and talks further, but they are interrupted by Dwight who is worried they are messing with the trophy case, giving Rafe the idea for his next prank. At Jules birthday dinner, Rafe makes a card of Jules and her kids, but Carl proposes and accidently spills water on it ruining the card. He then says that they should move in together, much to Rafe and Georgia's horror.At school, Rafe and Leo are turning the trophy case into an aquarium while Rafe laments over having Carl move in. Leo manages to convince him to focus on one problem at a time. When Dwight sees this the next day, he angrily creates new rules like no going to the bathroom while in school and that clubs and the Student Council elections are canceled. A nightmare sequence ensues when real life Dwight changes into the cartoon version and chases cartoon Rafe through the school. Rafe meets with Jeanne after school, but they are shut down and reprimanded by Dwight. Even though Rafe says he has no authority since its after school, Dwight says that because its on school grounds hes in charge. Once hes gone, they bond once more with Jeanne saying that kids all over are doing similar things to change their school. They comment on how, the graffiti, another prank Rafe pulled, is amazing even though she has no idea who did it. In Dwight's office, he and Sticker complain about how low the practice test scores are and soon realize that by taking out Tellers class, they have a better chance of scoring high in the B.L.A.A.R. test and devise a plan get them out.That night while Rafe is busy planting colors in the sprinkler system, Georgia overhears Bear try to send Rafe away. While he claims its for a psychologist, it is in actuality a military school. When Rafe gets back, he finds Georgia in his room to warn him. She tells him what he overheard and pleads with him to stop before its too late as she already lost a brother. She claims that although she puts on a tough face, there is no way she could handle Bear on her own. He agrees, and they share a hug before she leaves. At school the next day, Rafe tells Leo that he cant go through with the prank because of his promise to Georgia despite Leos pleas. Rafe enters Tellers class to see Dwight in there. He claims that he knows one of the students is the prankster and that he has proof of this. He opens their lockers and finds fish food, spray paint, sticky notes, balls, and hair dye in them. He decides to suspend the entire class. Teller defends them, claiming that they're good kids and that its strange they'd leave evidence in their lockers. He says he wants to go to someone with power and make a change, but Dwight claims he does even though Teller constantly refers to the superintendent. Dwight fires Teller for insubordination and suspicion that he might be involved. Horrified by what hes done, Rafe tries to confess. The Rules Arent For Everyone- R.A.F.E., every prank was him. However, Dwight doesnt care and offers him a chance to be the only one not suspended in exchange that hed keep quiet. Rafe stands on the principals desk and holds up a lighter, causing the sprinkler system to go off. In doing so, color is released and turns the students plain clothing colorful, all while Dwight yelling at Rafe that he is expelled.Once he gets home, Rafe is yelled at by his mom about what he had done, though Rafe merely defends himself by saying she told him he needed to think outside the box. She tells Rafe that she is going to have to reluctantly send him off to military school to Rafe's disbelief. She asks him why he didn't just tell her about his problems and he claims that no one would believe his word over his principal's, though Jules says she would have. She then comforts him, saying she knows how hard it was to lose his brother and that their bond was special and that both she and Georgia miss him too. She talks about how his father didn't stick around when he got sick and that she knows he sometimes talks to him and pretends hes there and that its okay to miss him and his brother is revealed to be Leo. The Leo seen up until now has merely been Rafe's imagination. Jules leaves and hugs Georgia who was out in the hall listening. Rafe then opens the card and reads the letter from Leo and tears up as he does. Jeanne then knocks on his window similar to how Leo did near the beginning and claims she knows Rafe was the one who set the pranks up. She shows a video tape of not only him setting it up the prank but him also admitting he likes her and him talking to someone named Leo. When Jeanne asks he then explains that Leo was his brother and best friend and he deeply misses him with Jeanne trying to comfort him. Jeanne then shows footage of Rafe's class being framed by Dwight and Gus who is being threatened with being fired if he doesn't cooperate. She reveals that the principal of the school with the highest test scores gets a bonus, explaining Dwight's behavior. The two decide to hatch a plan, contact the rest of the suspended class for help, and get Georgia to drive them by stealing Bears car. She purposefully drives it on the sidewalk to scratch and dents it. As the class gather, Rafe tells them the plan and Miller finally choose to respect Rafe. Gus helps them as he is also angry at Dwight. A montage shows seemingly unrelated events plays, including Gus cutting down a bush shaped like a number one, something that Dwight cared about.The next day as Dwight sees this and enters the school, he and Sticker are confused as to why all the students are taking the test outside. One student reads a question aloud about whether or not Dwight framed an entire class for suspension. He is horrified to learn that all of the tests have been replaced with false ones. On the roof Miller, in the school mascot costume, throws the shredded real test over the students. Rafe stands up and shows the tape with the proof on it. Sticker chases after him, but Gus rolls up in a cart with manure on a hitch, causing her to trip and fall. Dwight confiscates a bike and rides after them, running over Stickers back, causing her pain. An animated chase scene occurs with a zombie Dwight pedaling after Rafe and Gus and Rafe using his sketchbook to slow zombie Dwight down. When the cart stops, it switches back to the real world and Dwight claims to have caught them. Gus then hits a switch and causes the manure to fly at Dwight. As this is happening Jules finds that Rafe is missing and assumes that Georgia is at a friends house, Bear and Jules go to try and find Rafe, though Bear is much more concerned about his stolen car. Realizing her kids were right, Jules breaks up with Bear. Superintendent Hwang arrives (Angela Oh) with Teller in her car. She explains that Teller told her he was wrongfully terminated and that Dwight has been treating this school like a prison. Dwight professes his innocence, but Rafe has proof of what Teller is taking about. Dwight tries to denounce this as no one would believe Rafe since he doesn't test well, but Hwang does. Dwight is then scene packing up his office and still claims that he did nothing wrong. Hwang, however, points out that what he did was an actual crime and is that she is disgusted with his behavior. Dwight and Sticker leave and when Dwight puts on his hat, he finds that hair dye has been added in like before, only, this time, green. Jules reunites with her children while Bear freaks out over his car. Jules throws her engagement ring at Bear and mocks him. She then hugs her kids, happy that Rafe and Georgia are safe.Rafe meets Leo in a field at night. When Rafe asks what's next, Leo says that he has to go. Rafe doesn't want him to, but Leo only stuck around until Rafe made friends. An animated spaceship comes and to take Leo away, and they do their secret handshake on final time before he goes. Rafe then meets with Jeanne, claiming that not every rule was broken and they share a kiss on school grounds. From above, an animated Leo looks down and congratulates his brother. Aliens like the one from the beginning of the movie enter, guns pointed at Leo until he says their battle cry. A dance party soon starts with the cartoon versions of Dwight and Carl locked away in a cage on the ship, while Leo and the aliens fly off into space.