There is no "logic" to it. English has irregular nouns. You must remember the nouns that have this kind of plural. Fortunately it is a short list:
man-men, foot-feet, tooth-teeth, goose-geese, louse-lice, mouse-mice, and woman-women
Now you could ask why these nouns are irregular. The reason is different patterns of mutation and regularisation.
There is a pattern called "i-mutation. A back vowel like [u] tends to be raised towards [i] when followed by a raised vowel. Listen carefully to the the sound in "doing" (when spoken naturally and quickly). The word "doing" becomes pronunced as something like [diwin]. The [i] of "ing" causes the [u] to become raised.
A similar thing happened to Old English "mus" = "mouse". The plural /musiz/ became /misiz/. Then vowel changes took /mus/ to /maus/ and /misiz/ to /maisiz/. The plural ending wasn't needed and lazy speakers dropped the /-iz/ to make the plural /mais/ (which was spelled mice). You can read more about i-mutation
House, on the other hand underwent regularisation. Instead of the plural evolving towards an irregular form, it changed to the regular. There is no particular logic to why "house" was regularised, but "mouse" was mutated. However "house" resisted the change to /haisiz/ and took the regular plural. The tendency for irregular forms to become regular opposes the tendency of words to mutate. This tension gives rise to illogical pairs like "mice"/"houses".
The use of computer mouses is another example of regularisation. With the change in meaning comes "permission" (from the gods of grammar) to reconsider the plural and regularise the grammar. Some people have taken this opportunity. But most don't and the common plural of "computer mouse" is still "computer mice".