If a reviewer comments that the overall writing needs to be improved will they reject if some errors remain? I submitted the major revision and one reviewer's comment was to improve the overall writing. I'm trying to improve the flow and writing, but some grammatical errors and typos are still left.
Will they reject it directly or give me another chance?
First:  If you know your paper has grammatical or spelling errors, you must fix them before you submit the paper.  Otherwise, you risk wasting the editor and peer reviewers' time, which would be unethical.  Remember they are volunteers with other responsibilities.
If you did submit a paper that was perfect except for spelling and minor grammar errors, it usually would not be rejected.  Most journals make their decisions based on research content, not cosmetics.  Most journals employ a copyeditor to fix cosmetic errors the authors cannot fix.