Some journals publish the article online much before the publication, under the "ahead of print" section. My question is, will they send the proofs (to the author) before putting it in "ahead of print" itself, or only right before publication in print. What version will be published online under "ahead of print"?
Depends on journal policies. The one I'm most familiar with, the "ahead of print" articles are complete in every way except they've not been assigned to a volume & issue. If this is the case for you then of course they will send proofs to the author before putting it there.
Alternatively they can put the accepted manuscript there. If this is the case it will look very unpolished; it might not be in the journal's style, the figures might be on separate pages, and so on.
A glance at the articles already in the "ahead of print" section should reveal which is the case for you.