This is wrong. I understand why you say this, given the errors in the next quote.
> Even then your H1b lasts a total of 9 yrs, after which you can apply for green card and then get an EAD while waiting for your green card, which basically ensures you can stay in the country and work as long as your green card is processing.
The H-1B is issued for 3 years. You can renew it twice, after which you need to leave the country. If, within those 6 years, you have a green card application filed and have gone past the initial two stages, you can keep renewing your H-1B. But you will not get an EAD while you wait for the green card backlog to clear. Your stay in the country is not guaranteed while you wait. If you lose your job, you will have to leave the country if you don't find another similar job in a few months.