I used the word "present" instead of "gift" in my answer and got the question wrong. Is 선물 specifically "gift" and not present?
Yes, the order is important. Particles (like ~에게) are attached to count words
The number and count word go after 진구, and the count word there is for people
명 is a counter specifically for people, so there are 10 people the speaker gives presents to.
I wrote "I give presents to 10 friends" and it said "i give a gift to ten friends" so I think maybe i should not have made presents plural.