I don't see why you have to say anything about it now. And I certainly wouldn't say "I wasn't planning it, but I was planning it for a few months from now." That's not going to help, and it's not information the employer is entitled to. They can't discriminate on the basis of pregnancy. So you can't base your decision on whether it would make you look bad - pregnancy is supposed to be a non-issue in the workplace. That's not the reality, but it is the law.
I would tell him when you have to. If it's a small office and the people tend to be close, then you need to tell him when it's obvious. 4-5 months is fine, later if you want, and it gives them plenty of time to plan for a parental leave, which they are entitled to do. They are entitled to know when you are planning to leave, whether you are planning to come back, and you are only entitled to take the leave that is guaranteed by law. If you want additional considerations, then you have to negotiate those.
Meantime, concentrate on doing a really great job and being a valued employee - which you would do at any new job regardless of pregnancy. When the time comes, let them know how much you like the job and that you plan to take your leave and come back. At that point there might be some discussions of them hiring a temp and maybe you training that person, but right now, you don't even know if you're going to love this job or if they're going to love you. So I wouldn't throw anything else into the mix that, frankly, isn't relevant right now.