GitHub does not natively provide a way to merge only part of a pull request. However, it is possible for a maintainer to manually cherry-pick one or more commits into their repository, in which case you would be listed as the author and they would be listed as the committer.
Usually, though, if there are changes the maintainers don't want, they'll ask you to force-push your branch with only the changes they'd like to keep. Open source maintainers are usually busy enough that manually cherry-picking pieces is a hassle and it can often lead to conflicts which they don't want to resolve manually. Making you polish your submission is easier and puts the burden on you to create a quality submission.
It's also fine if your pull request gets reviewed and needs some changes. I contribute to Git on a regular basis, and almost nobody submits a patch and has it picked up immediately without changes. I recently sent 5 versions of a series before it was finally accepted. The review process is a chance for everyone involved to come to a set of changes that they feel good about and can be proud of.
GitHub does count contributions for which you are the author, even if someone else is the committer. The Git project itself uses a patch-based workflow where the maintainer accepts and applies patches from contributors, making the contributor the author and the maintainer the committer. These contributions are reflected on the author's GitHub profile just like any other contribution. Do note that only commits that end up in the default branch (usually master
) are counted.
In general, if you're unsure about what the maintainers of the project are looking for in a particular submission, you can open an issue and discuss your proposal (unless the contributing documentation says otherwise). That's often helpful both for you and the maintainers, because you don't write code you need to throw away and the maintainers get a quality contribution that meets their needs earlier on.