So first, normally you have to be in the area (1300) to get assist gold, you have to do damage on the unit to get +1 on your assist counter. For assist experience it is the same, 1300 in area. The killer does not have to be in range to get the killer experience and gold, but if it isn't in range of the 1300, it won't get assist gold/exp.
So that is what normally happens and you can apply that to your questions. When a hero dies to a tower/creep, it will check if anyone is around. If no one is around (like the Bone7 clip), it will give credit to nobody and everyone on the team splits the hero kill gold (which is around 100, so 20 each). If someone is in the 1300 area, but did not do damage, they will get the assist gold split between him and other heroes around. If one of the heroes did enough damage to get an assist counter (+1) and they are within 1300 range, they will be attributed the kill, and everyone in 1300 range gets the assist gold. If multiple heroes did enough damage to get an assist counter, they will split the gold.
In Summary (from the Wiki):
When a Hero dies to creeps or a tower and is assisted by only one enemy, the enemy is credited with the kill. When there are multiple enemies within 1300 range, the gold is split equally amongst all Heroes that assisted.
All allied Heroes that are in a 1300 radius of a killed enemy, including the killer, will be granted a certain amount of reliable gold and experience, depending on the amount of allied Heroes in that area. Note that the assist counter on the scoreboard only counts assists that you dealt damage to, but gold and experience are awarded independently of your "assist" counter.