How do I connect a subpanel with neutral and ground to the same bus bar in main panel?
bus bar singular?  

There are supposed to be two bus bars in every panel.  One for neutrals, and one for grounds.  

In the main panel ONLY, they are to be bonded together. This is what references your electrical system to earth voltage.  It must only be done one place in a system. 

Because of the required bond in the main panel, a great many electricians conclude that there is no difference between neutral and ground in the main panel since the N-G bond is right there.  And they simply spam all neutrals and grounds onto the same bus.   That logic is actually... reasonable... in the main panel. 

However... If you want to be a precise and competent worker, then you separate them always, as if every panel were a subpanel, and let the neutral-ground bond do its job.  This has a couple of neat benefits for you. 


if you convert that panel to a subpanel later, it's cake. 
if you want to troubleshoot a ground fault, you can remove the neutral-ground bond, and replace it with a wire which you loop 10 times and clamp an ammeter around the loop. Now the meter indicates ground leakage at 10x resolution.  It'll take you literally 30 seconds of snapping off breakers before you find which breaker it is.  That was easy. 
not that this is typically done in residential in the US, partly because of risk of damage to hardwired loads and controls... but you can separate the neutral-ground bond, then do insulation testing (megging) on the conductors to ground, to affirm no ground faults in the wiring proper.  This is especially important at higher voltages like 480/277.