This achievement is for collecting 20 different Legendary Weapons. E.g., if you have already collected The Lone Wanderer pistol and you later get a Legendary Dweller that comes with the same pistol, the achievement does not credit the second instance of that weapon. This also means that you cannot craft the same Legendary Weapon repeatedly in the Weapon Workshop to get the achievement.
You can get Legendary Weapons in four ways:
1) Finding legendary loot when exploring or on quests. Some quests will include Legendary Weapons and Legendary Outfits as rewards for the quest. Usually, when a legendary item is included in a quest, it will be shown in the quest screen, but I have also recovered legendary weapons and outfits on the intermittent exploration quests. When a Legendary Weapon is included on a Quest, it is either indicated by showing the actual weapon as a reward or is shown as a gold weapon icon to indicate that some Legendary Weapon will be rewarded.
2) Crafting weapons in the Weapon Workshop. Once you have enough dwellers, you can upgrade the Weapon Workshop to build Legendary Weapons. You will need to find recipes for the weapons on quests or on exploration quests. Legendary Weapons each require several pieces of legendary junk to build, as well as caps and time.
3) Legendary Dwellers sometimes come wielding a Legendary Weapon. Some Legendary Dwellers come wielding a Legendary Weapon, but the weapon will only count toward this achievement if you have not previously collected that weapon, e.g. Amata Almodovar, Butch DeLoria and Reginald Rothchild all come wielding The Lone Wanderer, but only one instance of the weapon will count toward the achievement.
4) Lunch boxes contain Legendary Weapons as rare cards. The same rules apply to duplicates.