Page redirect to 404 when set Permalink = “Post Name”

I believe the issue you are having is that the URL you have in your match tag, <match url=".*" /> needs to be url="*". Notice the absence of the dot. Currently your rule is only matching on URLs that end with an extension, like index.php, blog.html, background.jpg, etc. Removing the dot should allow it to match all URLs.