If a paper gets rejected two times (in two different journals) is that a bad impression if I try to submit in a different journal (different from the earlier two)?
No. In fact most of the time you do not need to (and should not) tell the editors of the new journal that your manuscript had been rejected elsewhere.
Of course, you should figure out why your manuscript was rejected and fix the issues if possible. For example if a referee says your manuscript is not acceptable because you need twice as much data to make your claims, then you should try to get twice as much data before submitting it to another journal.