In case failed to get luck in H1B lottery under MS cap, can it be possible to re-apply next year?

I am pursuing MS in CS and graduating in May 2018.

If I apply next year for H1B under MS cap and don’t get a luck,

can I re-apply subsequent year?

Someone informed that maximum twice H1B visa can be applied. Is it true?

You can apply as many times as until your employer is willing to apply for you. Someone must have told you 2 years on the context that your OPT might get exhausted.