Phonosemantic compound. 口 represents the meaning and 余 represents the sound. 口 (mouth) indicates that the character is only "mouthed", i.e. only used for its phonetic value.
Shuowen Jiezi
《說文》:“舍,市居曰舍。从亼、屮,象屋也。口象築也。”
Components
口(distinguishing) — Added to differentiate between 余 and 舍.