First off, let me link you to the free Core Rules
. It's basically the combat rules (and ONLY those) from the rule book. Those will actually answer your first 3 questions, though I've included the answers below.
1st, can characters join units, like how do my command squads work?
Not as such, but characters (with less than 10 Wounds) can ONLY be targeted if there is no non-character unit closer to the people that want to kill it. So if a Command Squad (or any other squad or tank) is standing in front of your Company Commander, he is safe... well, until his cover inevitably dies or your enemy deepstrikes behind him
Note your Command Squads are particularly versatile Veterans, so don't just use them for cover.
2nd, how line of sight work when trying to fire through units? if a unit has another unit infront of it can it ever fire? like if they are widely spaced apart giving some line of sight?, same with characters, how dense does the unit need to be to cover a character behind it?
Units don't offer cover to each other anymore. They can admittedly completely block line of sight, which blocks shooting (in both directions).
3rd, pistols in close combat, can you only use the pistol if ur stuck in 1" range during the shoot phase, or can you fire it in the combat phase ever?
If you're stuck in CC, you can still use the pistol in the Shooting phase (unlike all other weapon types).
4th what if any in my guard codex is relevant knowledge? like are the heirlooms still a thing?
Everything in the latest (8th Edition) Guard Codex is still relevant, though you'll want to check the Errata
for it on the Warhammer Community
site. If you're interested in Matched Play, some of the Point Costs have gotten updated in Chapter Approved - there will likely be a 2018 edition of it in a few months, so I'd suggest against picking up the 2017 edition.