You earn XP or experience points when you complete the Microsoft Learn content. You can find how much experience points are granted to you for each activity near the title of each page. If it is in green colour and has a tick at the end, you have earned that points, but if it is in grey colour then you have to complete some kind of activity mentioned in that page. If you completed that activity and it is still green you should check that you have done the activity correctly and checked your work by pressing the button to check your work.
Reputation points are granted to when you sign up to Q&A, one of your comments get voted and etc.
You can find more about reputation points in the link below:
(please don't forget to mark this answer as helpful by voting)