Clans are matched up based on the overall strength of its members. Strength is based on each member’s attacking power (troops, army camp capacity and spells) and defensive power (defense buildings, walls and traps). Heroes constitute towards a player's offensive and defensive power. Unlike in Multiplayer mode, trophies do not factor in when clans are matched.
The search tries to match Clans with similar Town Hall levels.
Different layouts and base designs do not affect strength. The only way a member’s strength can be changed is if they upgrade their troops, defenses, spells, etc.
Matchmaking will also factor in Win/Loss records. This ensures that your opponents are worthy adversaries.
However, matchmaking will always try to find matches within a tolerable time, which means adjusting the strictness of these rules if the search has already taken a long time. This causes variety in the quality of matchups.