Yesterday I emailed a professor inquiring about a research opportunity. He replied within an hour, told me to follow his profile to find the open position, and that he would be pleased to receive my application as I was fit for the position. I followed his profile on LinkedIn and emailed him that I would love to submit my application for position A. Now comes the awkward part, he wanted me to apply for position B, not position A. I think I seriously messed up this opportunity. He hasn't responded to my mail yet. My research area is better suited for position B. And the deadline he mentioned in his first email was for position B, too. Anyway, should I tell him I didn't know about position B since I am considering applying to it? (I didn't see position B. He posted position A two days ago and position B one week ago. I'm dumb. I hate LinkedIn now).
Perhaps you could apply for both and indicate which you'd prefer. Or, since it is a bit unclear, apply for the one you really want and indicate somehow, perhaps in a note (email) that you have additional interest in the other.
If the skill set for the two positions overlap, you are probably able to be considered for either.
Alternatively, just ask them which they think you are more suitable for, assuming you are more or less neutral between them, which may not be the case.
To be honest, this doesn't seem like a blunder on your part, just odd interleaving of times.
I followed his profile on LinkedIn and emailed him that I would love to submit my application for position A.
After you have been invited to apply, an email saying "I would love to submit my application for position A" is just noise that will be quickly ignored/archived. I would not expect a response to that email (what would the professor respond to that anyway?). At this point, he is waiting for an actual application, so just send that.
It is also not a blunder to apply for position A. If you are interested in both positions, then mention that in your application, stating your preference if you have any.
Just explain everything to him:
I just realized that I was looking at another position (A) with a different deadline, when I sent you my earlier email, before I noticed that there is also position B. I think my research area is better suited for position B, so I will submit an application for that. Sorry for any confusion!
I don't think you messed up anything, by the way. It's just a minor mistake.
Given that your professor seems to be of the type to encourage people, his heart is probably in the right place. If so, then I think if you simply explain the situation to him in a forthright manner, as you have to us, you'll find that he'll simply say, "Oh, of course, that makes more sense!"
If you can do it in person without being a bother to him, you'll likely get the best results. People are typically much warmer and much more facilitating towards a face in front of them than they are to a block of text on their desktop.
Also, most people who aren't horrible will appreciate humility. Showing that you are willing to say you think might have goofed up tends to be an endearing quality.
Personally, when hiring people, I like it when people are willing to admit ignorance or to point out a mistake they've made. It shows that they aren't prideful and won't stubbornly refuse to admit they're wrong some day in the future when it's crucial to know it so we can correct the problem they've caused.
Ignore his advice to you that you should apply for position B.
This is an old trick by hirers who do not want to give a plain refusal to applicants that they do not want for often unspoken reasons. They usually speak about a very attractive other vacancy about to arise in the near future that they feel would be much more suitable to someone of an applicant's obvious talents and other such flatteries.
Once you apply for position A you are now in a situation where you would have proffered yourself for position A by email and position B by formal application. This puts your motives in doubt.
And if you just let your decision to apply for position A ride for long more, you'll be deadlined out of consideration for it.
So ignore position B.
Put in a formal application for position A, as you had intended from the outset. But don't be surprised if your application is ultimately unsuccessful.
Ultimately I think you will be well rid of this professor.