Hello Hamlkan,
To submit form to share point library you will need to take Submit Data connection, for that follow these steps:
1. Open your InfoPath form in design mode
2. Go to Tools -> Data Connections
3. Click on Add, select Submit data and click on Next
4. Select “To a SharePoint form library” option and click on Next
5. Enter the SharePoint form library name in SharePoint form library to which you want to submit the form
6. Enter File name you would like to have for the forms and click on Next
7. Click on Finish and Close
8. Double click the button which has send as email code.
9. Click on Rules and click on Add
10. Click on Add Action
11. Select submit using a data connection in Action drop down, select Data connection which you have added just now and click on OK button for four times
Hope this helps!