Firstly, your JSON is not an array, so you shold add square brackets.
Moreover you should check for each level of your final array, if the value exists and eventually initialize an array and push the name inside it.
var results = $.parseJSON('['+resultJSON+']');
var obj = [];
$.each(results, function(i, res){
var l = res.l, p = res.p;
if(!obj[l]) obj[l] = [];
if(!obj[l][p]) obj[l][p] = [];
obj[l][p].push(res.name)
});
You can find a snippet here:
var resultJSON = '{"l":"1","p":"1","name":"john"}, {"l":"1","p":"2","name":"john1"},{"l":"1","p":"2","name":"john2"}';
var results = $.parseJSON('['+resultJSON+']');
var obj = [];
$.each(results, function(i, res){
var l = res.l, p = res.p;
if(!obj[l]) obj[l] = [];
if(!obj[l][p]) obj[l][p] = [];
obj[l][p].push(res.name)
});
$('#output1').text(JSON.stringify(obj));
$('#output2').text(JSON.stringify(obj[1][2]));
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<output id="output1"></output>
<br>
<output id="output2"></output>
EDIT
Alternative way:
var obj = {};
$.each(results, function(i, res){
var l = res.l, p = res.p;
if(!obj[l]) obj[l] = {};
if(!obj[l][p]) obj[l][p] = [];
obj[l][p].push(res.name)
});
//output {"1":{"1":["john"],"2":["john1","john2"]}}
push(yourVal)to add elements to Array