A man has been charged after a boy was allegedly shot and seriously injured inside a home in Sydney's north-west.