If your agent sells the house to his/her client, he/she should only charge you 4%. If the house is sold to other clients, the buyer's agent will get 2.5% so you have to pay 5%.
If you buy a house through an agent and then you let him/her sell your house. You may get discount on the agent fee. It means your agent get less than 2.5% for selling your house.