This Can’t Be Happening at MacDonald Hall by Gordon Korman, 1978.
Bruno and Melvin (called Boots) have been roommates ever since they began attending boarding school at MacDonald Hall. The two of them are best friends, and they do everything together. Quite a lot of what they do involves practical jokes. But, they’ve really been pushing the limit with their antics, and when they go a little too far during a hockey game, the headmaster gives them the ultimate punishment: they can no longer share a room. Mr. Sturgeon thinks that they’re a bad influence on each other. Each of them is assigned to a new roommate, and they won’t even be able to hang out together.
The prospect of losing each other as best friends is too much for Bruno and Boots. Besides, neither of them likes their new roommates. Boots has to share a room with George, who comes from a wealthy family and is only interested in money. George is also a germophobe who hates it that Boots sneezes every morning when he wakes up. Bruno’s new roommate is Elmer, the school’s supreme science nerd. Elmer isn’t happy about Bruno’s presence, either, because Bruno and his belongings take up valuable space that Elmer requires for his many projects. Obviously, the situation is completely intolerable for everyone.
Bruno, the idea man of the duo, declares that he will find a way for him and Boots to become roommates again. They meet secretly at night to discuss their plans. The boys try every tactic they can think of. They try making themselves completely obnoxious to their new roommates so that Mr. Sturgeon will have pity on them and give them their old room assignments. They try framing George and Elmer for some outrageous pranks of their own so Mr. Sturgeon will think that they’re a bad influence on Bruno and Boots. Bruno and Boots even try (as an extreme measure) behaving themselves! What will finally work?
This is the first book in the MacDonald Hall Series (or Bruno and Boots) series.