'Main' means I, and 'Maine' is just an additional 'ne' with 'Main'.
Both are used when subject 'I' does something however their use depends on the verb(mostly) and the object used. Some verbs need you to add 'ne' in the subject.
Here is a simple trick. If the passive voice a sentence (strictly making the object, the new subject) makes sense then you need to add 'ne' usually.
For example:
'Bread was eaten by me.' makes sense so use 'Maine'. But 'Bali was ......' doesn't really make sense so use just 'Main'
Of course, it's not applicable everywhere but it should be fine in most of the cases.