Like, maybe 6 or 7 guys.
I can explain if you are willing to keep an open mind.
Initially, there was no Iraqi, Afghani, or Pakistani on the Assad side. Back in say, 2011, or 2012, 2013. You can refer to dated news articles in Google or maybe even search early posts in this thread. How many pictures of Afghans can you find?
However, very early did we find foreigners involved against Assad. First of all, financial aid was given to rebels by countries such as Qatar (this is not secret, it was claimed proudly back in 2011) to overthrow the government. Fighters came from all around the world to join the fight against the government. Remember, a big clue are in the group's names. Fighters weren't coming in from Europe or Arab countries to set up a democratic government in Syria, they were encouraged by the idea of establishing a new Islamic, borderless caliphate. That was what was so appealing with ISIS for many young fighters. It wasn't about Syria, it was about Muslims. Therefore, it stopped being a war for Syria with them, it was a borderless war. That's why their name became Islamic State of Iraq and the Levant, that is, it is not about Syria anymore.
Now, when did the other side get involved? when ISIS was growing momentum daily in Syria, Iraq, Libya, Afghanistan, Yemen, etc. Why would the Iranians or the Afghans care about Assad? They don't actually care as much about Assad as they are concerned about the ALTERNATIVE. Afghans have already experienced terrorism in their country, Iraqis have already experienced it, Iranians have already experienced it. It is to no one's advantage to let terrorism grow until it reaches their land.
Try to read this poem by a German pastor in WW2. It is a very powerful poem, and please try to understand what I'm trying to say here.
First they came for the Socialists, and I did not speak out—
Because I was not a Socialist.
Then they came for the Trade Unionists, and I did not speak out—
Because I was not a Trade Unionist.
Then they came for the Jews, and I did not speak out—
Because I was not a Jew.
Then they came for me—and there was no one left to speak for me.