What do I have to say when I enter into a house?
Solution 1:
You would say this:
May I come in?
Or, more informally:
Can I come in?
However, proper etiquette would have your friend ask you to come in, by saying, for example, do come in, or please, come in, or something like that. If he does not ask you to come in, you should normally assume that he is busy and cannot receive you.
If the door is open, he steps back, and it is clear from context that he wants you to come in, you should take this as permission and just follow him inside. If you don't know him well and are in doubt, that is when you could ask, may I come in? As an alternative, you could just stay put, and he'd ask you in eventually, after an embarrassing moment—or not.
If he just says thank you for dropping by, you may assume he has no time to receive you, and you should shake hands and leave. You should never enter his house unless you'd been given some clear enough signal of permission. Clarity depends on context.
Solution 2:
There is no single expression that you "must say", and door greetings will vary widely by region. You will mostly discover that the host invites you in if they find you on their doorstep. Presuming they know you that is! If they don't know you they are more likely to ask your business and you must explain it on the porch until they feel like it's ok to invite you in. You cannot invite yourself in until there is a significant amount of trust, and even then it should be the host's responsibility to initiate.
However rare it will be that you need to invite yourself into a home, there may be cases --say you dropped by the neighbors where you are welcome but usually you are there just to say something quick and run off however this time you want to stay and talk-- in which you need to hint at your desire. In such cases you could get away with something simple like:
May I come in?
But a less direct approach that allows them to invite you in might be better:
Do you have a few minutes?