As far as I know, Skyteam has the same rules as pretty much every other airline or alliance: the miles for each ticket go to the person who actually uses that ticket to fly, provided they are registered in the program. It makes no difference who paid.
In your example, let's say the trip is 1000 miles long. No matter who pays, if you both register, and you both fly, then each of you gets 1000 miles. If you register and your friend does not, you get 1000 miles and your friend gets nothing.
See how it works? There is no way for you to earn miles for the ticket used by your friend, or vice versa.
Note that if possible, you should register for the miles program before the trip, and add your frequent flyer numbers to the ticket. While it is usually possible to claim the miles retroactively, the process is less convenient.