Would rather/ gerund as subject/ inversion with conditionals

1.  Would rather:

- Present or future:

Same subject: I'd rather stay at home 

Different subject: I'd rather you helped me 

- Past:

Same subject: I'd rather have stayed at home 

Different subject: I'd rather you had helped me

 

2. Gerund as the subject.

Having studied overseas has helped me a lot.

Drinking is bad for you

Studying is profitable 

 

3. Inversion with conditionals

- First conditional

If you need my help:

Should you need my help, I will be in my office.

- Second conditional

If you won the lottery

Were you to win the lottery, you could help me. 

- Third conditional

If I had won,

Had I won, I would be the best in my class