Hello and thanks for using Just Answer.
My name is ***** ***** am happy to assist you with your enquiry.
As this is your marital home, legally, you did not of course have to leave. Likewise, you are perfectly free to enter and leave the property as and when you wish. Yes, your wife can ask you to leave/provide notice if you intend visiting, but if you simply say no, there is nothing she can do about it unless there is a fear of violence or youhave been violent in which case, your wife can get a non-molestation order, being an Orderfor you to leave the property.
I am sure you will want to keep it amicable for the sake of your children, but as stated above, you do not have to give any sort of notice before visiting.
I hope this assists and sets out the legal position to you.