As for the second part of your post, you are asking a very pertinent and good question.
In the end, God knows who has lived and who hasn't. There will be a time for all of that to be worked out.
In one scripture it says something like "even if one sparrow falls God will know it"
To specifically answer your question, after the Second Coming, all the details will be worked out. Jesus will be here in front of all of us to direct the work.
As for now, people generally who are baptised for the dead are direct relatives of the members of the LDS church.
Thats why we do so much geneology. 99.9% of the baptisms for the dead are done for direct ancestors.
It seems to me that this narrow set of folks should have been used up LONG ago.....