I plan on entering Malta to get a residence permit, but from what I understand they will stamp my passport. I will do the biometric and then I will receive my id card and passport sticker. What will happen with the Schengen entry stamp? Will I need to exit the country and enter again with the residency permit? I’m also confused to know if the 2 weeks I will be there waiting for the process to be finish will be used against my 90 days Schengen time I plan to use in another Schengen country
What will happen with the Schengen entry stamp?
Nothing. The stamp records your entry into the Schengen area, nothing more. Notably, it says nothing about how long you are allowed to stay and nothing about your status in the Schengen area.
Will I need to exit the country and enter again with the residency permit?
Generally not. I don't know about Malta specifically, but in general most Schengen countries require most people to have entered with a long-stay ("type D") visa in order to be able to apply for a residence permit. There are some exceptions where people can enter as short-stay visitors (with or without a type C visa, depending on their nationality) and then switch to long-stay status by applying for a residence permit. If you are in the wrong status, you can't apply for a residence permit, so in that case you'd have to leave, get the right visa, and then reenter before applying. If your residence permit application is accepted and successful, you will not have to leave and reenter after receiving it.
I’m also confused to know if the 2 weeks I will be there waiting for the process to be finish will be used against my 90 days Schengen time I plan to use in another Schengen country
If you have a type D visa issued by Malta, no. Otherwise, yes, but as noted in a comment there is no systematic enforcement.