Lets say in a current project the team asked for training in a particular area to help them in the rest of the project and the product owner agreed and saw the value behind this training so it was put in the product backlog as a story "As developers we want to have training in X to be able to do Y". Now this story can fit in a single sprint and it is well detailed with acceptance test and every thing. Now in the sprint planning we will add this story and we need to split it to tasks with different training resources to take. Now all tasks must be done by all team members lets say one task is "Take the course here (url) to learn X" now when we try to put the effort hours of this task we make it normally as if it is one task then we multiply be all team members who are going to make it? as this task should be duplicated by all team members or what should be done?
You shouldn't need to multiply anything. The story can be "As developers we want to have training in X..." with its appropriate tasks which is correct form. The decision on if the story was met would be the acceptance criteria. The criteria should simply be that all developers [named here] have completed the training [successfully if there is a grade factor?]. In this way the story is not complete until all have done the training which is what you are looking for here.
Edit per question:
You would still estimate in the same manner as any other task except it would become a "team" task. Lets assume that this course is a 4 hour course and every one is taking it at the same time. You could simply apply 4hours * X people to the individual task estimation. Remember that by estimation here we are trying to account for nothing more than man hours.
Going back to the example, the estimation would be 16 hours (4 people * 4 hours) then that's all we care about here for tracking purposes. i.e that 16 of the teams total hours were dedicated to this task. This "team" task can be assigned to the project manager or team lead since they are responsible for everyone attending. This is how you use the task for accountability and ownership as well as tracking the time for the whole team.
As a side note to estimation: If you assume 40 hours per employee from my experience then you usually find out you over estimated for the sprint. i.e its often the case that hours are shorter than planned. We plan around 32 hours per employee a week. You can't plan around unanticipated interruptions or client calls etc so you build that slack time in.
In this example that means 16 of 128 hours of the teams time was spent on training.