Ernie Macmillan does not marry anyone in the Harry Potter series (books or films).
He is a Hufflepuff contemporary of Harry (prefect, D.A. member, fought at Battle of Hogwarts). His post-war life, spouse, and career are never detailed by J.K. Rowling (Pottermore/Wizarding World).
Fan fiction often pairs him with Susan Bones (fellow Hufflepuff/D.A.), but this is non-canon.