There Is No Rule
So it falls under a setting trope, but we'll come back to that.
In your first case, the character will return in the presence of the one doing the raising:
If the setting doesn't allow them to remember who brought them back, the caster in question will be close at hand to ask post-death.
In The Forgotten Realms...
A dead person becomes a petitioner. Until scooped up by their patron deity and brought to that deity's home plane, they are mindless beings. Even after reaching their patron's home plane, most petitioners remain mindless. Often, they're not even the same manner of creature as when they were alive - for example, many petitioners of The Triad eventually become lantern archons post-death.
So, in the Forgotten Realms, I'd say anything that happens while on the Fugue Plane or beyond (including attempts to resurrect) are not remembered when the recently dead ceases to be dead. Of course, how a mindless entity makes a decisions on who can raise them is a different (and unanswered) question.
In Other Settings
If you're not using a published setting, this is something you'd have to determine on your own. Unfortunately, there is no 5E source that covers it. Based on the releases to date, I don't expect there to be one. Your best bet to dig for ideas on how death works is probably 3E's Deities and Demigods.