Currently I'm creating a setting which includes real firearms models (no limitations, any gun I know about or find in the internet can appear) and I aim for each gun to be different from each other, however, I don't like complicated mechanics (in fact, I don't like mechanics at all) and basically everything is decided by simple d20 rolls. And I've already run into problems like "how exactly do I make HK 416 feel different from the M4"? Or how to differentiate between an AK 47 and AKM? Or various Glock pistols? M16A2 and M16A4? For example, I don't want all the AR-15 style rifles and carbines end up being the same in practice. So I ask all those gun nuts out there, how to achieve a system in which every firearm would behave as realistically as possible while keeping as little mechanics as possible?
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
In general, the amount of characterisation of weapons that is possible correlates very significantly with the existence of game-mechanical representations of various parameters to the optimisation of which the weapon caters.
Keep in mind that as a designer of a new system, it will be up to you to design and/or vet the weapon tables, likely while trying to make them representative of the real-world models of the weapons (and keep in mind that accuracy of knowledge of the latter can be non-trivial to ascertain).
Here are some parameters that may be relevant, and when they are likely to be or not be handled by a system. You will need to balance between simplicity and detail, and decide which ones you need and which ones you don't; I can't make the choices for you, but what I can do is provide some broad-strokes techniques for implementing a given type of weapon differentiation in a system. As per your comment, I'm focusing on dice-based systems, and not touching primarily card- or bidding-based systems.
- Accuracy. Almost all dice-based systems have some sort of roll to see if you hit. If so, weapons can vary by accuracy, giving a flat bonus or penalty. But on a d20 roll (as per your comment), a +1 is +5% chance of success, so weapons from the same class are unlikely to differ much.
- Damage. For systems which have a damage roll that is separate from the to hit roll, and that measure stopping power and wounds in hit points or other quantifiable units, differences in damage can be implemented quite easily.
- Range. There are several ways of implementing range differences in weapons. The simplest one is only having a maximum range past which attacks are considered ineffective (whether due to having no plausible chance to hit, or for more energy-loss and end-of-arc reasons). A more complex approach would be setting a range increment, each multiple of which gives a cumulative penalty to hit (Note: some system have a fixed table of range bands that are identical for all weapons). An even more complex one would be adding range increments that reduce damage (either gradually, or in big chunks).
- Automatic Fire, Rate of Fire, Controllability etc. In systems that distinguish between making a single attack per roll and making a burst or series of shots, maximum rate of fire may be an important parameter. There are many different ways RPG systems handle autofire, and depending on that, there may be parameters such as a bonus/penalty for the balance between the complications of recoil and benefits of walking the burst. This is some complex stuff and the design of autofire rules in RPG systems deserves a big separate question.
- Ammo Count and Typical Trained Reload Time. These are pretty self-explanatory. Black powder weapons can take a minute to reload, for example. Even modern weapons vary depending on the design, action type etc.
- Handling Parameters. These are usually complicated to implement. They can include such things as penalties for rushed aiming, for trying to shoot in close quarters, or trying to track a target with a high transversal speed. Most systems don't implement these parameters.
- Reliability. The chance of the firing mechanism jamming. Inconvenient to implement with a single d20 roll because that gives increments of 5% when it comes to chances, so at a minimum you'll need to use rerolls. Probably not worth the trouble, especially since reliability differences tend to be exaggerated in tales of gun enthusiasts.
- Concealability. A modifier to attempts to hide the weapon, which is likely to differ in combat-ready and disassembled form.
- Volume / Report. Weapons can differ either by the modifier to hear and/or see them from a distance, or by the distance at which the roll to see and/or hear them is unmodified and/or possible (depending on how the system implements perception rolls).
- Special Sighting, Targeting and Similar Add-Ons. Like scopes. Some systems have advanced rules on shooting with scopes, or on effects of other aiming systems. These are probably also worth their own separate question, being potentially complex.
- Cost and Availability. Some guns may be harder to buy for purely monetary reasons (takes more coins or requires a higher wealth attribute, depending on system). Others may take long time and effort to even find, possibly requiring difficult rolls of contacts-oriented skills.
An alternative to stat-based differentiation is a tag-based differentiation. That means that each weapon has some number of concise descriptive tags. Instead of applying all the time, the tags can be used as cues (whether system-supported or freeform) to occasionally enable tag-appropriate events. For example, Standard Issue in [Military] may let a character carry it without raising suspicion while pretending to be a member of said military, while Reliable, but Maintenance-Heavy may mean that the gun works fine even in bad conditions so long as it's regularly cared for, but becomes more prone to misfire than other guns when not (and adventurers do get into situations where they don't have enough free time to do that).
Admittedly, tag-based differentiation is more geared towards descriptor-oriented systems (like various FATE games). I'm not sure if those are what you're looking for.
First up: I've never held a gun, I don't know what feels different about firing one gun to another. As such, I'm not going to provide you with an exact answer of how to model a pistol vs a rifle, and especially not how to make one pistol feel different to another. Instead I'm going to aim to give you good questions to think about, and suggest some dials you can turn to produce different effects.
It's also worth remembering that your two requirements of "a few systems as possible" and "as much differentiation as possible" work in opposition to each other. You are going to have to find a compromise somewhere in the middle that works for you.
Your answers to these may be the same for all guns, or vary wildly between guns, it's up to you.
How do you want the game to feel?
Are you aiming for simulation or arcade fun? Somewhere in between? Do you want your players storming into a room and shooting from the hip, or hiding behind cover and looking down sights?
How deadly do you want the guns to be?
This will have a huge impact on how the players interact with the game. The deadlier the guns, the more realistic and tense the game will be, but the fewer risks your players will take. There's two parts to it: how often do the guns hit, and when they hit how much is it going to hurt? Inaccurate, but very dangerous guns will make for a "swingy" game which is much more reliant on random chance. This can be tense when well-tuned, or frustrating and unfair when poorly tuned. Accurate pea-shooters will level out the RNG, but can lead to the game feeling like a grind. As a rule the guns should be more effective on the NPCs than the players
What effect will range/armour/cover have?
Does it affect damage or accuracy? How safe should a riot shield / solid wall make you? Does flanking someone behind cover offer a significant bonus (ala XCOM)? Is there any way to force an enemy out of cover? The safer cover is the less your players will want to leave it.
How frequently should the player fire?
This can take several different forms. They might be able to fire multiple times per round, or need to a take a round to reload every 5 shots.
Mecahnics you can use:
Here are a few different systems you could use and tweak to suit different guns. Again, you could choose to use two entirely different systems for different gun types. This increases the complexity of your game, but will make them feel very different, and means there isn't necessarily a numerical-mechanical solution to your game.
Roll to hit, constant damage
This is a very simple system that allows for some differentiation. Each character has an armour class, each weapon has a bonus to hit and damage rating. d20 + bonus to hit => deal appropriate damage.
Roll to hit, damage based on accuracy
A slight modification on the first one. Could be fun for a scoped-style of weapon to give a mechanical flavour to head shots & the like. Each weapon has a set of damages based on how high the to hit roll was. e.g. 1-5 above AC 1 damage, 5-7 above AC 3 damage, 7+ above AC 5 damage.
Always hit, roll for damage
This might work well for a Looper-style blunderbuss. If you have line of sight within 15', you hit, otherwise you miss. Roll for damage. Weapons can have different ranges, damage dice to roll, and modifiers to those dice.
How dice are used
There's a lot of different ways you can use and combine dice that produce very different feelings. For a machine gun you could model the high fire rate by rolling a fistful of d4s, adding up the result and using that as damage. For a sniper rifle you might roll 2-3 d20s and take the highest/lowest/middle result. The bigger and fewer the dice the swingier the result. The number of dice could be affected by armour & range, or other environmental effects.
How to get started
This is a big task. It's a fun task, but it's big. To start with, don't worry about details. Pick 3-5 classes of gun, make them as different as possible. Different ranges, different damage, different everything. Try to find a combination of mechanics that simulate each class well. Don't worry about precise numbers, just rough ranges. Once you have those sorted then you can start to differentiate within the classes.
Importantly make sure you don't just pick some numbers and ideas in your head, actually have a play with them. Roll some dice, see what's fun. Once you think you have something interesting invite friends over and see if they enjoy it. Find what works and doesn't then make tweaks.
As a final note, there's an old podcast from 10 years ago I'm going to try to dig up where Mike Mearls discusses adding guns to DnD 4e and how they could be different to bows. It's worth listening to if you can find it.