Canon wise rasengan is actually a mess of retcons and plot holes. The timeline of a few characters comes into play when talking about its creation. Some say it would have to have been created during the third ninja war. In actuality canon wise that's hard to prove.
First and foremost the only two people that learned rasengan from Minato are Kakashi and Jiraiya. The two characters time frames have to align with minato being able to tech them and thats where it gets dicey.
Rasengans timeline is actually hard to narrow down specifically because its these two characters that learn it.
Problem Character 1: Kakashi- Kakashi used chidori to kill Rin in canon. Chidori is nothing more than a lightning release Rasengan. Its the base for the jutsus creation.
Chidori itself was created some time before kakashi became a jonin. This is because prior to using it to kill Rin he first attempted it on his first jonin mission trying to kill an iwa ninja named Mahiru.
This means by age 12 Kakashi knows how to use rasengan enough to make his own variation.
Looking at Kakashis ninja career we know he was in team Minato and was a genin starting at age 5,becoming chunin at age 6. Kakashi is said to have taken Minatos bell test to become a genin which leaves several issues as far as his team mates ages go but that's a whole separate issue.
Point is Kakashi has to have learned the rasengan prior to 12 since he tests it out in the field for the first time at 12. Despite having no sharingan since Rin and Obito are alive at this point by the way. Considering he's a genius lets assume he learned the jutsu at age 11 and already created a derivation by age 12. This establishes that Minato had rasengan before or somewhere between Team Minatos existence over six years. It also means Kakashi had to learn the rasengan during the third shinobi war.
Knowing Kakashi had to have learned the Rasengan during the third shinobi war is important because the time frame of the shinobi world wars is really weird. Its specifically stated in shippuden that Sakumo killed Sasoris parents 21 years prior during the second war. Leaving Sasori an orphan, who ironically also starts the third shinobi war. Chiyo states its been 20 years since she's seen Sasori who hasn't aged a day, Sasori dies the same year they meet at age 35. This means at age 15-16 he made himself a puppet and a missing nin. That means at some point after he kills the third kaze and starts the third ninja war.
This is important because Kakashis age is supposed to be 29-31 at the start of Shippuden. That means at the very least he is age 9-11 when the third ninja war STARTS. Most likely 9 since he becomes jonin at age 12 and also anbu captain at age 12. Minato assigns him the captain role as the 4th kage by the way, a role he doesn't get until the end of the third war. Point being the third war according to these characters timelines lasts a period of three years.
Minato states it takes him three years to create rasengan. This implies that Minato created the Rasengan before the third shinobi war because kakashi already knows Rasengan prior to being age 12. Even if we say kakashi learned rasengan a few months before his 12th birthday and first use of chidori the rasengans creation time still lasts the entire length of the war.
All of this ties back in to Minato who to our knowledge is 24 when he and Kushina die. Minatos birthday is in january and kushinas is in july. She dies giving birth. Its stated in canon that naruto is a 10 month pregnancy. Naruto is born october 10th. Which means naruto is conceived in november- december. That would mean minato and kushina were both 23 when he became the 4th. We can corroborate they conceive after he becomes the fourth because Kushina is not pregnant when minato becomes the fourth. If the third ninja war lasted 3 years that means at the start of the war Minato was likely 20. This means when Minato is age 20 kakashi is age 9 in other words rasengan, if we try to force a tight timeline, would have to be created when minato is age 19 and kakashi is age 8.
Ironically this leads to: When would Minato see a tailed beast ball prior to the start of the third war?
the two tails is probably a no since yugito dies in shippuden at 29 with sasori as the guideline she would be the same age as kakashi (9) at the start of the third war meaning its unlikely minato encountered her at any point prior also she became the two tails host at age 2 so she's definitely out.
the three tails is impossible as its sealed until placed into Rin who dies during the third war.
the four tails was sealed into roshi 40 years before the 4th ninja war. He received the four tails when he was young and opted to leave the village shortly after to master the power of the four tails. The fourth war is 18 years from when the third ended aka had minato lived he would of been 42, with roshi being gone form his village for 40 years theres no way they ran into each other.
The five tails participated in the third war not before so not him.
The six tails has the same issue as the two tails. Utakata dies at 26. means he is six years old during the third war with no previous known hosts its safe to say this is a no.
The seven tails doesnt get a host until shippudens time so definite no.
The eight tails host was blue b, the third raikages partner for the time he ruled. he was killed by the third raikage himself who sealed the eight tails until b took over. this is the same third raikage who died goin 1 vs 10K During gthe third War. the time frames dont add up for minato to encounter blue b prior to his death.
According to kushina after she got together with minato the nine tails was completely sealed thanks to the power of love(barf). Which means kushina never could use the tailed beast ball after they got together. They got together after her kidnapping incident which happened to kushina at age 12-13. So not her.
By order of elimination it seems minato saw the one tails use the tailed beast ball at one point. gaara gets the one tails before even being born so that means by part 1 gaara has been the host for about 14 years. The fourth kaze tried sealing it with in all his own children, with temari being the older than gaara by 3 years. in other words up until a year after the third war there seems to be no host to the one tails. the reason i say no host is that the third dies to start the third war which means the fourth kaze took over during the third war and for some reason didn't choose a new host until gaara. Prior to Garaa though there is an unnamed host that the third kaze learned to control iron sand from.
Using the info given there's still another option apart from the one tails. The nine tails is still possible since prior to the rescue event kushina still lacks control. Either way the only time frame for Minato to see a tailed beast ball would be the second ninja war.
Team minato has existed for four years prior to the third ninja war since minato is their jonin sensei when kakashi becomes genin at age 5. This makes Minato a jonin at 16. Minato himself is on team jiraiya starting at age 10 (his academy graduation age) this means he likely spent six years on team Jiraiya.
Which leads us to...
Problem Character 2: Jiraiya- Jiraiya knowing how to use Rasengan is actually a pretty big plot hole. Why? Because he says he was personally taught the jutsu by Minato.
Jiraiya was to canon knowledge absent during the third ninja war like Tsunade. opposite him Minato was extremely active during the third war. No way he learned the jutsu from him during that time.
Which means he has to have learnt it after or before the third war. The after also being impossible because shortly after the war he becomes a wanderer and doesn't visit Konoha again until midway through Kushinas pregnancy giving naruto his name. That's important because that means Minato was already the 4th Kage then soon after.. you.. know .. dies. Jiraiya doesn't stick around long enough to master a jutsu that by all estimates should take at least a month.
Main point being Jiraiya had to have learned Rasengan during the second shinobi war. Which is a big problem since he spent 3 years with the Ame trio.
That leaves learning the jutsu from Minato before meeting the trio since he leaves them towards the end of the second war and the start of the third war. With the time gap between the wars being a matter of a year it really gives Jiraiya no viable option to learn the jutsu other than before becoming one of the Sannin.
In other words taking the 20 year old Minato at the start of the third war you have to substract the three years for the Ame twins away. Leaving a 17 year old Minato with Rasengan but no time to teach Jiraiya because he had his own team to train at 16 years old. So minus one year. Than subtract another 3 years to make the jutsu in the first place.
This means Minato started creating the jutsu at 12-13 probably. Since the nine tails was fully sealed according to the love birds after the kushina incident when she was 12, well...
Minato likely saw the tailed beast ball of the one tails, the only active tailed beast during the second ninja war, or the nine tails tailed beast ball during the kidnap incident. More to the point this is the only time frame in which he is on team Jiraiya. As such its the only feasible time he could of taught Jiraiya his jutsu based on Jiraiyas own timeline against Minatos. Meaning that Jiraiya likely knew how to use Rasengan before fighting Hanzo.
In the end honestly the canon is so sketchy with ages in Naruto that either this is all right or completely off due to some other random character. The biggest guideline for the wars is Sasori since he starts the third war off. Which makes Chiyos statements very important because it sets in stone that Sasoris parents died during the second war 21 yrs prior. Then she sets up that Sasori became a missing nin 20 years prior. The gap between the wars is no more than a year based on her statements.
This giant rant ladies and gentleman is how weirdly intense I research Naruto lore for the fan fiction. Even then I'm not sure I have it right because the lore is not great with ages and aligning them to the canon timeline.