The First thing you should do at the Beginning of this mission is to fast travel to Diamond City and Before you set up your meeting with Nick, head straight towards Mayor's Office(Night Time preferable) where you'll find him sitting at this office and his secretary is sleeping in the next room, so ignore bot hof them and search the first room with safe and get your hands on Kellogg's House Key.
The other way that totally depends on your Charisma stats is that you can talk to the secretary to get the keys for you and in return you can bribe her the some amount of caps. Now head straight to set up the meeting with Detective Nick Valentine. Now you would be entering the Agency where Nick and Ellie are having a conversation and do not ask for any rewards in return and guess what you get 100 caps just like that.
First look at the chair across Nick and have a sit before you start any conversation and then just try this magic trick with Nick's conversation by selecting every option shown on Nick's Table no matter what order it is in and it will work. After the first part of the conversation, you will start informing Nick about a bald man with scars who took Shaun away from your partner. Continue with your conversation Which lead to the conclusion that Kellogg can be the victim.
After the conversation is over, get outside the building from the back door where Nick is waiting outside for you. Keep following him until Kellogg's house and then he will first try to unlock the door and later ask you to give it a try. Now as you have got the keys from the very start of this Mission it's time to unlock the Door and skip the side objective to get the Kets to Kellogg's house.
Now that Kellogg had taken hostage your only son so it's fair to steal everything you can from his house. Kellogg will not back so go ahead and get hands on everything you can. Once you are done with stealing go and meet Valentine at Kellogg's desk and then press the secret button under the desk to unleashed the secret room. In the Secret Room have a loot at the shelves on the left and loot everything you can and later go to the table and pick up the next clue which is San Francisco Sunlight.
Valentine had named your Dog as Dogmeat and he is no longer nameless. If you don't have a clue what to do next try to ask Valentine and he will suggest you to show the cigar to Dogmeat. Later you ask Valentine to join you with your next Quest as he has become very useful to hack the terminal/doors and attract attentions for you. Now that you show the Cigar to Dogmeat, the Main Mission 5 comes to an end.