Words ending in '-m' take '-ns' in the plural: 'homem', 'homens'
In Portuguese, a noun or adjective that ends in -m does not simply add -s in the plural. The -m turns into -n and then the -s is added: homem becomes homens, jardim becomes jardins, bom becomes bons and som becomes sons.
English speakers trip over this because English just adds -s to almost everything, so forms like homems or mensagems feel natural. They are always wrong. Portuguese spelling never allows -ms at the end of a word. The good news is that the rule has no exceptions among ordinary words, and the sound barely changes.
The final -m in these words is not a real m sound. It only shows that the vowel before it is nasal. In the plural, Portuguese writes that nasal sound with n instead, because n comes before consonants such as s. The vowel keeps the same nasal sound, and you add a light s.
-em becomes -ens: nuvem, nuvens
-im becomes -ins: fim, fins
-om becomes -ons: bom, bons
-um becomes -uns: atum, atuns
Nothing else changes. Gender stays the same: a viagem, as viagens. Articles and adjectives around the word agree as usual.
Os homens fizeram várias viagens.
(The men made several trips.)
As nuvens estão escuras.
(The clouds are dark.)
The words
Nouns in -agem and -igem
This is the biggest group, and all of these nouns are feminine: imagem, mensagem, garagem, viagem, bagagem, paisagem, tatuagem, vantagem, desvantagem, chantagem, massagem, miragem, embalagem, pastagem, aterrissagem, decolagem, passagem, portagem, porcentagem, barragem, bandagem, peregrinagem, origem and vertigem. Personagem belongs here too. It can be masculine or feminine.
As mensagens tinham imagens.
(The messages had images.)
Comprei duas passagens para Lisboa.
(I bought two tickets to Lisbon.)
Other nouns in -em
homem, lobisomem, nuvem, trem, margem, ordem, desordem, virgem, bem (asset, plural bens), armazém and refém.
som, tom, batom, garçom, edredom, atum, jejum, álbum and fórum.
Os garçons deste restaurante são simpáticos.
(The waiters in this restaurant are friendly.)
Adjectives
The rule works the same way for bom, ruim, jovem (also a noun, a young person), marrom, comum, incomum and selvagem.
Eles são bons homens.
(They are good men.)
Os jovens gostam de sapatos marrons.
(Young people like brown shoes.)
Watch out
Accents stay where they are
Words with a written accent keep it: armazém, armazéns, refém, reféns, álbum, álbuns, fórum, fóruns. Words without an accent do not gain one: jovem, jovens, viagem, viagens.
Guardo as fotos antigas em dois álbuns.
(I keep the old photos in two albums.)
Ruins is not ruins
The plural of ruim is ruins, which looks like the English word but means bad. In Portuguese, ruins as ruined buildings are ruínas.
Esses filmes são muito ruins.
(Those films are really bad.)
The typical mistake is writing -ms. If you ever see -ms at the end of a Portuguese word you have written, change it to -ns.
Summary
If a noun or adjective ends in -m, swap the -m for -ns in the plural: homem, homens; fim, fins; bom, bons; álbum, álbuns. Gender and accents stay the same, and a Portuguese word never ends in -ms.